-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] Routes with host/locale matrix not working correctly #38209
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
Given generated matching routes, it looks like the problem may be related to the |
@odolbeau Thanks, additional info: Without
With
So that non-strict rule is always there as a first one. FYI: I've run |
@nicolas-grekas is it expected that we still have a route without any host requirement when we use locale-based host requirements ? |
@xabbuh could you remove "Waiting feedback" label, since I've provided additional information 2 weeks ago? @nicolas-grekas could you take a look at @stof's comment? |
Nope, it's not. PR welcome. |
Hey, thanks for your report! |
Bug still exists in Symfony 5.2.6, here's reproducer → https://github.com/Wirone/symfony-issue-38209 |
Bug still exists on 5.3, I've pushed commit with bumped dependencies to reproducer. |
It took me a while to figure this out, but there is no bug here:
|
Symfony version(s) affected: 5.1.5
Description
I've followed #30617 (and symfony/symfony-docs#13571) for configuring support for locales based on host. When I access page through host mapped to non-default locale, page still renders in default locale.
How to reproduce
With config above
RedirectableCompiledUrlMatcher
has this route collection for this path:Unfortunately, the first one is matched when I access page via
pl.foo.loc
, so locale is not set and page displays in default locale.ℹ️ When I comment out first rule, matching hosts work and locale is set properly.
Maybe I do something wrong but mentioned docs are not merged so support for this feature is somehow undocumented 😉
Possible Solution
Move non-strict rule (without host matching) to the end of the collection for path, so it can run as fallback if other rules (hosts) aren't matched.
CC: @odolbeau
The text was updated successfully, but these errors were encountered: