Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[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

Merged
fabpot merged 1 commit intosymfony:5.1fromyceruto:route_priority_with_prefix
Jun 10, 2020

Conversation

@yceruto
Copy link
Member

QA
Branch?5.1
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#37089
LicenseMIT
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')) {
Copy link
MemberAuthor

@ycerutoycerutoJun 9, 2020
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Fixed name collision

Copy link
Member

@nicolas-grekasnicolas-grekas left a 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
Copy link
MemberAuthor

yceruto commentedJun 9, 2020
edited
Loading

This is called here for instance:

if (null !==$namePrefix) {
$subCollection->addNamePrefix($namePrefix);
}

even if the name prefix is not defined, due to:

$namePrefix =$config['name_prefix'] ??'';

I wonder if we should compare with empty string instead or change to$config['name_prefix'] ?? null and save some ticks.

@nicolas-grekas
Copy link
Member

@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;
Copy link
MemberAuthor

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;

@ycerutoycerutoforce-pushed theroute_priority_with_prefix branch from2a294fe to1010526CompareJune 10, 2020 11:52
@fabpot
Copy link
Member

Thank you@yceruto.

@fabpotfabpot merged commit7c892ee intosymfony:5.1Jun 10, 2020
@ycerutoyceruto deleted the route_priority_with_prefix branchJune 10, 2020 16:02
@fabpotfabpot mentioned this pull requestJun 12, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@xabbuhxabbuhxabbuh approved these changes

+1 more reviewer

@TobionTobionTobion approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@yceruto@nicolas-grekas@fabpot@Tobion@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp