Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Routing] Keeping routes priorities after add a name prefix to the collection#37176
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
yceruto commentedJun 9, 2020
| Q | A |
|---|---|
| Branch? | 5.1 |
| Bug fix? | yes |
| New feature? | no |
| Deprecations? | no |
| Tickets | Fix#37089 |
| License | MIT |
| Doc PR | - |
| $prefixedRoutes[$prefix.$name] =$route; | ||
| if (null !==$name =$route->getDefault('_canonical_route')) { | ||
| $route->setDefault('_canonical_route',$prefix.$name); | ||
| if (null !==$canonicalName =$route->getDefault('_canonical_route')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Fixed name collision
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Cool thanks for having a look
yceruto commentedJun 9, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This is called here for instance: symfony/src/Symfony/Component/Routing/Loader/YamlFileLoader.php Lines 217 to 219 in6d6d989
even if the name prefix is not defined, due to:
I wonder if we should compare with empty string instead or change to |
nicolas-grekas commentedJun 9, 2020
@yceruto that'd make sense yes |
| $methods =isset($config['methods']) ?$config['methods'] :null; | ||
| $trailingSlashOnRoot =$config['trailing_slash_on_root'] ??true; | ||
| $namePrefix =$config['name_prefix'] ??''; | ||
| $namePrefix =$config['name_prefix'] ??null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
consistent with Xml loader:
| $namePrefix =$node->getAttribute('name-prefix') ?:null; |
Uh oh!
There was an error while loading.Please reload this page.
2a294fe to1010526Comparefabpot commentedJun 10, 2020
Thank you@yceruto. |