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

AddExpressionLanguageProvidersPass breaks custom routers #37042

Copy link
Copy link
Closed
@wizhippo

Description

@wizhippo
Issue body actions

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

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