-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
AddExpressionLanguageProvidersPass breaks custom routers #37042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Would you mind sending a PR, branch 5.1? |
Personally I think the pass should target |
wizhippo
added a commit
to wizhippo/symfony
that referenced
this issue
Jun 1, 2020
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 symfony#37042
wizhippo
added a commit
to wizhippo/symfony
that referenced
this issue
Jun 1, 2020
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 symfony#37042
fabpot
added a commit
that referenced
this issue
Jun 11, 2020
… to router.default (wizhippo) This PR was squashed before being merged into the 5.1 branch. Discussion ---------- [DependencyInjection] Apply ExpressionLanguageProviderPass to router.default | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #37042 | License | MIT 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. Commits ------- 215ad1f [DependencyInjection] Apply ExpressionLanguageProviderPass to router.default
symfony-splitter
pushed a commit
to symfony/framework-bundle
that referenced
this issue
Jun 11, 2020
… to router.default (wizhippo) This PR was squashed before being merged into the 5.1 branch. Discussion ---------- [DependencyInjection] Apply ExpressionLanguageProviderPass to router.default | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix symfony/symfony#37042 | License | MIT 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. Commits ------- 215ad1f93d [DependencyInjection] Apply ExpressionLanguageProviderPass to router.default
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 suchAddExpressionLanguageProvidersPass
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.symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php
Line 34 in e60a876
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 ofrouter
and stipulateroute.default
has to be the symfony router or extended class.The text was updated successfully, but these errors were encountered: