From 717663aac1f2c20e8859ed5f0834c82b4b6e6098 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Wed, 17 Jan 2018 09:58:59 -0800 Subject: [PATCH] Fixing a bug where the dump() function depended on bundle ordering --- .../DependencyInjection/Compiler/ExtensionPass.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php index c829cfa437..e3f700f457 100644 --- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php +++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php @@ -85,7 +85,11 @@ class ExtensionPass implements CompilerPassInterface if ($container->getParameter('kernel.debug')) { $container->getDefinition('twig.extension.profiler')->addTag('twig.extension'); - $container->getDefinition('twig.extension.debug')->addTag('twig.extension'); + + // only register if the improved version from DebugBundle is *not* present + if (!$container->has('twig.extension.dump')) { + $container->getDefinition('twig.extension.debug')->addTag('twig.extension'); + } } $twigLoader = $container->getDefinition('twig.loader.native_filesystem');