Skip to content

Commit

Permalink
Apply to router.default
Browse files Browse the repository at this point in the history
Using a `chain_router` usually replaces the `router` and add the `router.default` to it's chain.

This would `addExpressionLanguageProvider` to the default router only as the chain router is not expected to have `addExpressionLanguageProvider` as it is not part of the router interface.

See #37042
  • Loading branch information
wizhippo committed Jun 1, 2020
1 parent e5b5d9e commit 2cf2472
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -28,8 +28,8 @@ class AddExpressionLanguageProvidersPass implements CompilerPassInterface
public function process(ContainerBuilder $container)
{
// routing
if ($container->has('router')) {
$definition = $container->findDefinition('router');
if ($container->has('router.default')) {
$definition = $container->findDefinition('router.default');
foreach ($container->findTaggedServiceIds('routing.expression_language_provider', true) as $id => $attributes) {
$definition->addMethodCall('addExpressionLanguageProvider', [new Reference($id)]);
}
Expand Down

0 comments on commit 2cf2472

Please sign in to comment.