Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3a8f905

Browse filesBrowse files
committed
bug #25824 Fixing a bug where the dump() function depended on bundle ordering (weaverryan)
This PR was merged into the 2.7 branch. Discussion ---------- Fixing a bug where the dump() function depended on bundle ordering | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | not needed If DebugBundle is registered *before* TwigBundle, then the simpler `dump()` function wins over the fancy, var-dumper one from DebugBundle. In other words, you get different functionality based on the *order* in which you install libraries. To get the "bad" way, you can: ``` composer create-project symfony/skeleton show_bad_dump cd show_bad_dump composer require symfony/debug-bundle composer require twig ``` Then create a Twig template with a `dump()` inside. It will use the less-fancy XDebug version. I'm not sure if there's a more elegant fix for this or not... I have verified locally that this DOES fix the issue. Thanks! Commits ------- 717663a Fixing a bug where the dump() function depended on bundle ordering
2 parents 132cec4 + 717663a commit 3a8f905
Copy full SHA for 3a8f905

File tree

1 file changed

+5
-1
lines changed
Filter options

1 file changed

+5
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ public function process(ContainerBuilder $container)
8585

8686
if ($container->getParameter('kernel.debug')) {
8787
$container->getDefinition('twig.extension.profiler')->addTag('twig.extension');
88-
$container->getDefinition('twig.extension.debug')->addTag('twig.extension');
88+
89+
// only register if the improved version from DebugBundle is *not* present
90+
if (!$container->has('twig.extension.dump')) {
91+
$container->getDefinition('twig.extension.debug')->addTag('twig.extension');
92+
}
8993
}
9094

9195
$twigLoader = $container->getDefinition('twig.loader.native_filesystem');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.