10000 AddExpressionLanguageProvidersPass breaks custom routers · Issue #37042 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
AddExpressionLanguageProvidersPass breaks custom routers #37042
Closed
@wizhippo

Description

@wizhippo

Symfony version(s) affected: 5.1

Description
Previously in 5.0 there were no services tagged with routing.expression_language_provider so the issue did not arise. There is in 5.1 so the issue can occur.

addExpressionLanguageProvider is not part of the router interface. As such AddExpressionLanguageProvidersPass should not use it if the router does not support it as the router could be replaced with a custom router that does not support the function.

$definition->addMethodCall('addExpressionLanguageProvider', [new Reference($id)]);

How to reproduce
Example ezplatform replaces the router.default with its own router which does not implement addExpressionLanguageProvider nor should it have to if it is not part of the interface.

Possible Solution
Check it router supports addExpressionLanguageProvider first.
Make addExpressionLanguageProvider part of the router interface.
Apply to router.default instead of router and stipulate route.default has to be the symfony router or extended class.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0