Skip to content

Commit 5d797b2

Browse files
committed
minor symfony#23356 [TwigBundle] gracefully handle missing hinclude renderer (xabbuh)
This PR was merged into the 3.2 branch. Discussion ---------- [TwigBundle] gracefully handle missing hinclude renderer | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Since symfony#23272 the `ExtensionPass` from the TwigBundle will error when being used with FrameworkBundle 3.4 thus letting all `deps=high` build jobs fail. Commits ------- ebdbecf gracefully handle missing hinclude renderer
2 parents d051ef4 + ebdbecf commit 5d797b2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ public function process(ContainerBuilder $container)
6565
$container->getDefinition('twig.extension.httpkernel')->addTag('twig.extension');
6666

6767
// inject Twig in the hinclude service if Twig is the only registered templating engine
68-
if (
69-
!$container->hasParameter('templating.engines')
70-
|| array('twig') == $container->getParameter('templating.engines')
71-
) {
68+
if ((!$container->hasParameter('templating.engines') || array('twig') == $container->getParameter('templating.engines')) && $container->hasDefinition('fragment.renderer.hinclude')) {
7269
$container->getDefinition('fragment.renderer.hinclude')
7370
->addTag('kernel.fragment_renderer', array('alias' => 'hinclude'))
7471
->replaceArgument(0, new Reference('twig'))

0 commit comments

Comments
 (0)