Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try #1117

Closed
wants to merge 2 commits into from
Closed

Try #1117

wants to merge 2 commits into from

Conversation

VincentLanglet
Copy link
Member

Subject

I am targeting this branch, because {reason}.

Closes #{put_issue_number_here}.

Changelog

### Added
- Added some `Class::newMethod()` to do great stuff.

### Changed

### Deprecated

### Removed

### Fixed

### Security

@eerison
Copy link
Contributor

eerison commented Sep 22, 2022

I'll give a try in your branch :D

@eerison
Copy link
Contributor

eerison commented Sep 22, 2022

do you need to update your branch?

Problem 1
    - sonata-project/seo-bundle[3.3.0, ..., 3.x-dev] require sonata-project/block-bundle ^4.6 -> satisfiable by sonata-project/block-bundle[4.6.0, ..., 4.x-dev].
    - You can only install one version of a package, so only one of these can be installed: sonata-project/block-bundle[dev-tryVincent, 3.0.0, ..., 3.x-dev, 4.0.0, ..., 4.x-dev].
    - sonata-project/page-bundle dev-require_last_version_of_block_bundle requires sonata-project/block-bundle dev-tryVincent as 4.16.2 -> satisfiable by sonata-project/block-bundle[dev-tryVincent].
    - sonata-project/page-bundle dev-require_last_version_of_block_bundle requires sonata-project/seo-bundle ^3.3 -> satisfiable by sonata-project/seo-bundle[3.3.0, 3.x-dev].
    - Root composer.json requires sonata-project/page-bundle dev-require_last_version_of_block_bundle as 4.0.0 -> satisfiable by sonata-project/page-bundle[dev-require_last_version_of_block_bundle].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
root@985f350667bb:/app# 

@VincentLanglet
Copy link
Member Author

You should use

dev-tryVincent as 4.18

@eerison
Copy link
Contributor

eerison commented Sep 22, 2022

You should use

dev-tryVincent as 4.18

ops

@eerison
Copy link
Contributor

eerison commented Sep 22, 2022

It's not catching the exception!

@eerison
Copy link
Contributor

eerison commented Sep 22, 2022

Twig\Error\RuntimeError:
An exception has been thrown during the rendering of a template ("The block service `sonata.seo.block.email.share_button` does not exist").

  at vendor/sonata-project/page-bundle/src/Resources/views/Block/block_container.html.twig:15
  at Twig\Template->displayBlock('block_child_render', array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin), '_parent' => array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), '_seq' => array(object(SonataPageBlock), object(SonataPageBlock), object(SonataPageBlock)), 'loop' => array('parent' => array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), 'index0' => 0, 'index' => 1, 'first' => true, 'revindex0' => 2, 'revindex' => 3, 'length' => 3, 'last' => false), 'child' => object(SonataPageBlock), '_key' => 0), array('block' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block'), 'block_class' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_class'), 'block_role' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_role'), 'block_child_render' => array(object(__TwigTemplate_ee14b3162ccd64b865d6db649e296aee), 'block_block_child_render')))
     (var/cache/dev/twig/a7/a71e2e497387d0ff6dcc6d582691dca1.php:139)
  at __TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f->block_block(array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin), '_parent' => array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), '_seq' => array(object(SonataPageBlock), object(SonataPageBlock), object(SonataPageBlock)), 'loop' => array('parent' => array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), 'index0' => 0, 'index' => 1, 'first' => true, 'revindex0' => 2, 'revindex' => 3, 'length' => 3, 'last' => false), 'child' => object(SonataPageBlock), '_key' => 0), array('block' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block'), 'block_class' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_class'), 'block_role' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_role'), 'block_child_render' => array(object(__TwigTemplate_ee14b3162ccd64b865d6db649e296aee), 'block_block_child_render')))
     (vendor/twig/twig/src/Template.php:171)
  at Twig\Template->displayBlock('block', array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('block' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block'), 'block_class' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_class'), 'block_role' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_role'), 'block_child_render' => array(object(__TwigTemplate_ee14b3162ccd64b865d6db649e296aee), 'block_block_child_render')))
     (var/cache/dev/twig/05/0510d582990bbf1fa7da00c303877039.php:66)
  at __TwigTemplate_d435fb943812d16a601ff59c0a533e59->doDisplay(array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('block' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block'), 'block_class' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_class'), 'block_role' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_role'), 'block_child_render' => array(object(__TwigTemplate_ee14b3162ccd64b865d6db649e296aee), 'block_block_child_render')))
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling(array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('block' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block'), 'block_class' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_class'), 'block_role' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_role'), 'block_child_render' => array(object(__TwigTemplate_ee14b3162ccd64b865d6db649e296aee), 'block_block_child_render')))
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display(array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('block_class' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_class'), 'block_role' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_role'), 'block' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block'), 'block_child_render' => array(object(__TwigTemplate_ee14b3162ccd64b865d6db649e296aee), 'block_block_child_render')))
     (var/cache/dev/twig/a7/a71e2e497387d0ff6dcc6d582691dca1.php:50)
  at __TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f->doDisplay(array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('block_class' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_class'), 'block_role' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_role'), 'block' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block'), 'block_child_render' => array(object(__TwigTemplate_ee14b3162ccd64b865d6db649e296aee), 'block_block_child_render')))
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling(array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('block_class' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_class'), 'block_role' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block_role'), 'block' => array(object(__TwigTemplate_ffd0a4617d33634b0a7d9715eed89b7f), 'block_block'), 'block_child_render' => array(object(__TwigTemplate_ee14b3162ccd64b865d6db649e296aee), 'block_block_child_render')))
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display(array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('block_child_render' => array(object(__TwigTemplate_ee14b3162ccd64b865d6db649e296aee), 'block_block_child_render')))
     (var/cache/dev/twig/ff/ff2bc35fd4f52c62a44b838fef1377e5.php:48)
  at __TwigTemplate_ee14b3162ccd64b865d6db649e296aee->doDisplay(array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('block_child_render' => array(object(__TwigTemplate_ee14b3162ccd64b865d6db649e296aee), 'block_block_child_render')))
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling(array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content'), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('block_child_render' => array(object(__TwigTemplate_ee14b3162ccd64b865d6db649e296aee), 'block_block_child_render')))
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display(array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content')))
     (vendor/twig/twig/src/Template.php:379)
  at Twig\Template->render(array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content')), array())
     (vendor/twig/twig/src/TemplateWrapper.php:40)
  at Twig\TemplateWrapper->render(array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content')))
     (vendor/twig/twig/src/Environment.php:277)
  at Twig\Environment->render('@SonataPage/Block/block_container.html.twig', array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content')))
     (vendor/sonata-project/block-bundle/src/Block/Service/AbstractBlockService.php:43)
  at Sonata\BlockBundle\Block\Service\AbstractBlockService->renderResponse('@SonataPage/Block/block_container.html.twig', array('block' => object(SonataPageBlock), 'decorator' => array('pre' => '', 'post' => ''), 'settings' => array('layout' => '{{ CONTENT }}', 'class' => '', 'use_cache' => true, 'extra_cache_keys' => array(), 'attr' => array(), 'template' => '@SonataPage/Block/block_container.html.twig', 'ttl' => 86400, 'code' => 'content')), object(Response))
     (vendor/sonata-project/page-bundle/src/Block/ContainerBlockService.php:81)
  at Sonata\PageBundle\Block\ContainerBlockService->execute(object(BlockContext), object(Response))
     (vendor/sonata-project/block-bundle/src/Block/BlockRenderer.php:70)
  at Sonata\BlockBundle\Block\BlockRenderer->render(object(BlockContext))
     (vendor/sonata-project/block-bundle/src/Templating/Helper/BlockHelper.php:454)
  at Sonata\BlockBundle\Templating\Helper\BlockHelper->render(object(SonataPageBlock), array())
     (vendor/sonata-project/page-bundle/src/Twig/Extension/PageExtension.php:194)
  at Sonata\PageBundle\Twig\Extension\PageExtension->renderBlock(object(SonataPageBlock), array())
     (vendor/sonata-project/page-bundle/src/Twig/Extension/PageExtension.php:178)
  at Sonata\PageBundle\Twig\Extension\PageExtension->renderContainer('content', object(SnapshotPageProxy))
     (var/cache/dev/twig/ec/ecd8f078e1dd6cf1a7c7a65896ddc021.php:216)
  at __TwigTemplate_2aa42510ab6c10468858721df8069038->block_page_content(array('error_codes' => array('_page_internal_error_not_found', '_page_internal_error_fatal'), 'page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin), 'content' => ''), array('sonata_page_html_tag' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_html_tag'), 'sonata_page_head' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_head'), 'sonata_page_stylesheets' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_stylesheets'), 'sonata_page_javascripts' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_javascripts'), 'sonata_page_body_tag' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_body_tag'), 'sonata_page_top_bar' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_top_bar'), 'sonata_page_container' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_container'), 'sonata_page_asset_footer' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_asset_footer'), 'sonata_page_breadcrumb' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_breadcrumb'), 'page_content' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_page_content')))
     (vendor/twig/twig/src/Template.php:171)
  at Twig\Template->displayBlock('page_content', array('error_codes' => array('_page_internal_error_not_found', '_page_internal_error_fatal'), 'page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('sonata_page_html_tag' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_html_tag'), 'sonata_page_head' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_head'), 'sonata_page_stylesheets' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_stylesheets'), 'sonata_page_javascripts' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_javascripts'), 'sonata_page_body_tag' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_body_tag'), 'sonata_page_top_bar' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_top_bar'), 'sonata_page_container' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_container'), 'sonata_page_asset_footer' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_asset_footer'), 'sonata_page_breadcrumb' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_breadcrumb'), 'page_content' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_page_content')))
     (var/cache/dev/twig/ec/ecd8f078e1dd6cf1a7c7a65896ddc021.php:110)
  at __TwigTemplate_2aa42510ab6c10468858721df8069038->block_sonata_page_container(array('error_codes' => array('_page_internal_error_not_found', '_page_internal_error_fatal'), 'page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('sonata_page_html_tag' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_html_tag'), 'sonata_page_head' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_head'), 'sonata_page_stylesheets' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_stylesheets'), 'sonata_page_javascripts' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_javascripts'), 'sonata_page_body_tag' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_body_tag'), 'sonata_page_top_bar' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_top_bar'), 'sonata_page_container' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_container'), 'sonata_page_asset_footer' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_asset_footer'), 'sonata_page_breadcrumb' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_breadcrumb'), 'page_content' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_page_content')))
     (vendor/twig/twig/src/Template.php:171)
  at Twig\Template->displayBlock('sonata_page_container', array('error_codes' => array('_page_internal_error_not_found', '_page_internal_error_fatal'), 'page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('sonata_page_html_tag' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_html_tag'), 'sonata_page_head' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_head'), 'sonata_page_stylesheets' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_stylesheets'), 'sonata_page_javascripts' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_javascripts'), 'sonata_page_body_tag' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_body_tag'), 'sonata_page_top_bar' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_top_bar'), 'sonata_page_container' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_container'), 'sonata_page_asset_footer' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_asset_footer'), 'sonata_page_breadcrumb' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_breadcrumb'), 'page_content' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_page_content')))
     (var/cache/dev/twig/17/17de26996b008eaa3c0e74715c963c0d.php:69)
  at __TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1->doDisplay(array('error_codes' => array('_page_internal_error_not_found', '_page_internal_error_fatal'), 'page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('sonata_page_html_tag' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_html_tag'), 'sonata_page_head' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_head'), 'sonata_page_stylesheets' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_stylesheets'), 'sonata_page_javascripts' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_javascripts'), 'sonata_page_body_tag' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_body_tag'), 'sonata_page_top_bar' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_top_bar'), 'sonata_page_container' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_container'), 'sonata_page_asset_footer' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_asset_footer'), 'sonata_page_breadcrumb' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_breadcrumb'), 'page_content' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_page_content')))
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling(array('error_codes' => array('_page_internal_error_not_found', '_page_internal_error_fatal'), 'page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('sonata_page_html_tag' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_html_tag'), 'sonata_page_head' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_head'), 'sonata_page_stylesheets' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_stylesheets'), 'sonata_page_javascripts' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_javascripts'), 'sonata_page_body_tag' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_body_tag'), 'sonata_page_top_bar' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_top_bar'), 'sonata_page_container' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_container'), 'sonata_page_asset_footer' => array(object(__TwigTemplate_81babb41dd30e9fbdc438bfadc8a1fc1), 'block_sonata_page_asset_footer'), 'sonata_page_breadcrumb' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_breadcrumb'), 'page_content' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_page_content')))
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display(array('error_codes' => array('_page_internal_error_not_found', '_page_internal_error_fatal'), 'page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('sonata_page_container' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_container'), 'sonata_page_breadcrumb' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_breadcrumb'), 'page_content' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_page_content')))
     (var/cache/dev/twig/ec/ecd8f078e1dd6cf1a7c7a65896ddc021.php:50)
  at __TwigTemplate_2aa42510ab6c10468858721df8069038->doDisplay(array('error_codes' => array('_page_internal_error_not_found', '_page_internal_error_fatal'), 'page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('sonata_page_container' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_container'), 'sonata_page_breadcrumb' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_breadcrumb'), 'page_content' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_page_content')))
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling(array('error_codes' => array('_page_internal_error_not_found', '_page_internal_error_fatal'), 'page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite), 'wrap_fields_with_addons' => true, 'app' => object(AppVariable), 'sonata_block' => object(GlobalVariables), 'sonata_config' => object(SonataConfiguration), 'sonata_page' => object(GlobalVariables), 'sonata_page_admin' => object(PageAdmin)), array('sonata_page_container' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_container'), 'sonata_page_breadcrumb' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_sonata_page_breadcrumb'), 'page_content' => array(object(__TwigTemplate_2aa42510ab6c10468858721df8069038), 'block_page_content')))
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display(array('error_codes' => array('_page_internal_error_not_found', '_page_internal_error_fatal'), 'page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite)))
     (vendor/twig/twig/src/Template.php:379)
  at Twig\Template->render(array('error_codes' => array('_page_internal_error_not_found', '_page_internal_error_fatal'), 'page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite)), array())
     (vendor/twig/twig/src/TemplateWrapper.php:40)
  at Twig\TemplateWrapper->render(array('error_codes' => array('_page_internal_error_not_found', '_page_internal_error_fatal'), 'page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite)))
     (vendor/twig/twig/src/Environment.php:277)
  at Twig\Environment->render('@SonataPage/layout.html.twig', array('error_codes' => array('_page_internal_error_not_found', '_page_internal_error_fatal'), 'page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite)))
     (vendor/sonata-project/page-bundle/src/Page/TemplateManager.php:99)
  at Sonata\PageBundle\Page\TemplateManager->renderResponse('default', array('page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite)), object(Response))
     (vendor/sonata-project/page-bundle/src/Page/Service/DefaultPageService.php:56)
  at Sonata\PageBundle\Page\Service\DefaultPageService->execute(object(SnapshotPageProxy), object(SiteRequest), array('page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite)), object(Response))
     (vendor/sonata-project/page-bundle/src/Page/PageServiceManager.php:83)
  at Sonata\PageBundle\Page\PageServiceManager->execute(object(SnapshotPageProxy), object(SiteRequest), array('page' => object(SnapshotPageProxy), 'site' => object(SonataPageSite)), object(Response))
     (vendor/symfony/http-kernel/HttpKernel.php:159)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(SiteRequest), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:81)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(SiteRequest), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle(object(SiteRequest))
     (public/index.php:26) 

@VincentLanglet
Copy link
Member Author

Ok my bad, according to the stack trace, the issue is coming from this line indeed
https://github.com/sonata-project/SonataBlockBundle/blob/4.x/src/Templating/Helper/BlockHelper.php#L451

which is coming from this line
https://github.com/sonata-project/SonataBlockBundle/blob/4.x/src/Block/BlockRenderer.php#L70

The exception manager strategy is used but this a TwigRuntimeError because this line is failing
https://github.com/sonata-project/SonataBlockBundle/blob/4.x/src/Block/Service/AbstractBlockService.php#L43

Which is trying to render this template
https://github.com/sonata-project/SonataPageBundle/blob/4.x/src/Resources/views/Block/block_container.html.twig#L15

which calling again https://github.com/sonata-project/SonataPageBundle/blob/4.x/src/Twig/Extension/PageExtension.php#L194

But why this time the exception is not handled by the strategy manager exception ?

@VincentLanglet
Copy link
Member Author

You said here: #1115 (comment)
that the exception strategy didn't solve the issue @eerison, but it should combined with this PR: #1115.
What was the issue ?

@eerison
Copy link
Contributor

eerison commented Sep 23, 2022

Until this file: PageExtension.php#L194 Our Exception is raised.

But when Pass into the https://github.com/sonata-project/SonataPageBundle/blob/4.x/src/Resources/views/Block/block_container.html.twig#L15 twig handle it internally

converting to RuntimeException

@eerison
Copy link
Contributor

eerison commented Sep 23, 2022

But there are other problem!

even if I create a new filter checking the twig exception (to skip the exception), and a child block fail, all container is skipped

e.g

container_main
   - block 1
   - block 2
   - block 3

in this case if some child block broken (like block 2), the whole container block will be skipped

@eerison
Copy link
Contributor

eerison commented Sep 23, 2022

this exception strategy should receive the exception only, not block and response :/

@VincentLanglet
Copy link
Member Author

VincentLanglet commented Sep 23, 2022

Until this file: PageExtension.php#L194 Our Exception is raised.
But when Pass into the https://github.com/sonata-project/SonataPageBundle/blob/4.x/src/Resources/views/Block/block_container.html.twig#L15 twig handle it internally
converting to RuntimeException

But it shouldn't be raised if the strategy manager is enabled...

I mean, what you're saying is that container rendering receive a Twig Error which is not handled by the ExceptionManager.
But

  • Container is calling render with a try catch and the exceptionManager
  • Inside the try catch we're calling the rendering of every children
  • Each children is calling render with a try catch and the exceptionManager => I expect to catch the exception here

Does your reproducer is open source ? I'd like to debug

@eerison
Copy link
Contributor

eerison commented Sep 23, 2022

Until this file: PageExtension.php#L194 Our Exception is raised.
But when Pass into the https://github.com/sonata-project/SonataPageBundle/blob/4.x/src/Resources/views/Block/block_container.html.twig#L15 twig handle it internally
converting to RuntimeException

But it shouldn't be raised if the strategy manager is enabled...

I mean, what you're saying is that container rendering receive a Twig Error which is not handled by the ExceptionManager. But

  • Container is calling render with a try catch and the exceptionManager
  • Inside the try catch we're calling the rendering of every children
  • Each children is calling render with a try catch and the exceptionManager => I expect to catch the exception here

Does your reproducer is open source ? I'd like to debug

Ok now it's public

https://github.com/nortopecas/norto-system/tree/add_page_bundle_symfony_4_4

@VincentLanglet
Copy link
Member Author

Ok now it's public

https://github.com/nortopecas/norto-system/tree/add_page_bundle_symfony_4_4

Thanks, it works fine.

Can you explain me how to reproduce the bug ?
I know nothing about PageBundle usage.

I suppose I need to create sharedBlock ? And then ?

@eerison
Copy link
Contributor

eerison commented Sep 23, 2022

Back to sonata page version 3 and add a email (can be more 2 or 3 :D ) block there!
and after that back to version 4, as the email block doesn't exist in version 4, your page should return the error above!

@VincentLanglet
Copy link
Member Author

Back to sonata page version 3 and add a email (can be more 2 or 3 :D ) block there! and after that back to version 4, as the email block doesn't exist in version 4, your page should return the error above!

I'll need more explanation. Which page ? Which url ?
Like I said, I know nothing about this PageBundle.

if possible I'll need explanation like
Go to url ... click on ... then go to url ... click on ...

@eerison
Copy link
Contributor

eerison commented Sep 23, 2022

Screenshot 2022-09-23 at 10 36 52
Screenshot 2022-09-23 at 10 39 11

after you create add the email block, go into localhost:8001, you should see the issue

@VincentLanglet
Copy link
Member Author

after you create add the email block, go into localhost:8001, you should see the issue

Any reason I'm getting No route found for "GET /" ?

@eerison
Copy link
Contributor

eerison commented Sep 23, 2022

hmmm I'm not sure why!

maybe you need to run those commands: https://docs.sonata-project.org/projects/SonataPageBundle/en/3.x/reference/getting_started/

@VincentLanglet
Copy link
Member Author

Thanks.

So I made some try, and it's works fine with the config

sonata_block:
    default_contexts: [sonata_page_bundle]
    exception:
        default:
            filter: ignore_block_exception

and the PR #1115

And it only hide the missing block but display others.

@eerison
Copy link
Contributor

eerison commented Sep 23, 2022

And it only hide the missing block but display others.

is it showing something for you? for me page is blank 👀

@VincentLanglet
Copy link
Member Author

And it only hide the missing block but display others.

is it showing something for you? for me page is blank 👀

It shows all the block which exists and just display nothing for the email block

@eerison
Copy link
Contributor

eerison commented Sep 23, 2022

can you post here the screenshot how is your blocks and how it looks like in your page?

@VincentLanglet
Copy link
Member Author

image

I have

image

Then I did
image
inside my vendor to simulate the fact that template doesn't exists (And to use BlockServiceNotFoundException)
and I see
image

@eerison
Copy link
Contributor

eerison commented Sep 24, 2022

it doesn't happen with me, all block are skipped :/

@eerison
Copy link
Contributor

eerison commented Sep 24, 2022

and it's blank only if I use debug filter, if I use the filter that check this exception, my page is still broken.

@VincentLanglet
Copy link
Member Author

Do you also use the blockservicéotfound pr ?

@eerison
Copy link
Contributor

eerison commented Sep 24, 2022

if you mean this PR: #1115
Yes I tested with this PR and with this config

sonata_block:
    default_contexts: [sonata_page_bundle]
    exception:
        default:
            filter: ignore_block_exception

@VincentLanglet
Copy link
Member Author

if you mean this PR: #1115 Yes I tested with this PR and with this config

It worked fine for me editing https://github.com/nortopecas/norto-system/blob/add_page_bundle_symfony_4_4/config/packages/sonata_page.yaml#L5 and with the 1115 PR.

I would recommend you to dump the strategy used in your code/vendor.
That's how i discovered that this config https://github.com/nortopecas/norto-system/blob/add_page_bundle_symfony_4_4/config/packages/sonata_block.yaml was overriden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants