Skip to content

Blank page in admin after install on Sylius > 2 - fix #44

@a-k-holod

Description

@a-k-holod

After successfull instalation, new page in admin shows blank page rather than mail test form and there are some hooks (type?) errors.

I fixed it by overriding hooks from:
vendor/synolia/sylius-mail-tester-plugin/config/twig_hooks/admin/mailtester/update.yaml
in:

config/packages/sylius_twig_hooks.yaml


sylius_twig_hooks:
    supported_hookable_types: 
        admin: Sylius\TwigHooks\Hookable\HookableTemplate
        shop: Sylius\TwigHooks\Hookable\HookableTemplate
        component: Sylius\TwigHooks\Hookable\HookableComponent
        template: Sylius\TwigHooks\Hookable\HookableTemplate
        disabled: Sylius\TwigHooks\Hookable\DisabledHookable
       
    enable_autoprefixing: true

    hooks:
        sylius_shop.base.header.content.logo:
            content:
                template: 'shop/header/content/logo/content/logo.html.twig'
        sylius_shop.base.head:
            google_tag_manager_head:
                template: 'shop/analytics/google_tag_manager_head.html.twig'
                priority: 100
        sylius_shop.base.header:
            google_tag_manager_body:
                template: 'shop/analytics/google_tag_manager_body.html.twig'
                priority: 100

        'synolia.sylius_admin.mailtester':
            sidebar:
                template: '@SyliusAdmin/shared/crud/common/sidebar.html.twig'
                priority: 200
            navbar:
                template: '@SyliusAdmin/shared/crud/common/navbar.html.twig'
                priority: 100
            content:
                template: '@SyliusAdmin/shared/crud/common/content.html.twig'
                priority: 0
        'synolia.sylius_admin.mailtester.content':
            flashes:
                template: '@SyliusAdmin/shared/crud/common/content/flashes.html.twig'
                priority: 400
            header:
                template: '@SyliusAdmin/shared/crud/common/content/header.html.twig'
                priority: 300
            form:
                type: template                     # <-- this is a plain Twig template, not a component
                template: '@SynoliaSyliusMailTesterPlugin/admin/mailtester/content/form.html.twig'
                context: {}                        # optional
                configuration: {}                  # optional
                priority: 200
            footer:
                template: '@SyliusAdmin/shared/crud/common/content/footer.html.twig'
                priority: 100

Now it works, but make sure NOT to test on first single email option, as admin_password_reset subject throws:
No resolvable form found for email admin_password_reset.

Sending All and all other single options works well and show in mailhog (if links and pictures doesn't work for you - add port to channel host through admin)

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions