8000 bug #39350 [FrameworkBundle] Remove translation data_collector BEFORE… · symfony/symfony@66e8ae9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 66e8ae9

Browse 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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

AE30 Lines 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