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 66e8ae9

Browse filesBrowse files
committed
bug #39350 [FrameworkBundle] Remove translation data_collector BEFORE adding it to profiler (l-vo)
This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle] Remove translation data_collector BEFORE adding it to profiler | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | There is an order problem between `DataCollectorTranslatorPass` and `ProfilerPass`. Currently `DataCollectorTranslatorPass` is registered after `ProfilerPass`. So if `data_collector.translation` is removed, it has already been added to the profiler and the compilation fails. The simplest approach seems to move `DataCollectorTranslatorPass` before `ProfilerPass`. Use case: When I want to use `IdentityTranslator` (for the test environment for instance) which doesn't implement `TranslatorBagInterface`. Commits ------- 2420b67 [FrameworkBundle] Remove translation data_collector BEFORE adding it to profiler
2 parents 30dc962 + 2420b67 commit 66e8ae9
Copy full SHA for 66e8ae9

File tree

1 file changed

+1
-1
lines changed
Filter options

1 file changed

+1
-1
lines changed

‎src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ public function build(ContainerBuilder $container)
119119
$container->addCompilerPass(new RegisterControllerArgumentLocatorsPass());
120120
$container->addCompilerPass(new RemoveEmptyControllerArgumentLocatorsPass(), PassConfig::TYPE_BEFORE_REMOVING);
121121
$container->addCompilerPass(new RoutingResolverPass());
122+
$container->addCompilerPass(new DataCollectorTranslatorPass());
122123
$container->addCompilerPass(new ProfilerPass());
123124
// must be registered before removing private services as some might be listeners/subscribers
124125
// but as late as possible to get resolved parameters
@@ -139,7 +140,6 @@ public function build(ContainerBuilder $container)
139140
$container->addCompilerPass(new FragmentRendererPass());
140141
$this->addCompilerPassIfExists($container, SerializerPass::class);
141142
$this->addCompilerPassIfExists($container, PropertyInfoPass::class);
142-
$container->addCompilerPass(new DataCollectorTranslatorPass());
143143
$container->addCompilerPass(new ControllerArgumentValueResolverPass());
144144
$container->addCompilerPass(new CachePoolPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 32);
145145
$container->addCompilerPass(new CachePoolClearerPass(), PassConfig::TYPE_AFTER_REMOVING);

0 commit comments

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