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] Fix resource miss#24642

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

Closed
dunglas wants to merge2 commits intosymfony:2.8fromdunglas:fix-router-resource

Conversation

@dunglas
Copy link
Member

QA
Branch?2.8
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

Some routing resources are not watched. To reproduce:

  1. Install Symfony 4
  2. Change something inconfig/routes.yaml

The change is not taken into account.

This PR fixes this bug.

$subCollection->addPrefix($this->prefix);

$routeCollection->addCollection($subCollection);
foreach ($route->resourcesas$resource) {
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be handled by$routeCollection->addCollection instead ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This doesn't work because$route->build() (https://github.com/symfony/symfony/pull/24642/files#diff-61a7c46324774b76b342efb3f3e87b7fL310) doesn't add sub-resources to$subCollection. This is exactly what this patch fix.

Copy link
Member

Choose a reason for hiding this comment

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

it is adding them just a few lines below in this code.

Copy link
Contributor

Choose a reason for hiding this comment

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

$route->resources vs$this->resources

Copy link
Contributor

Choose a reason for hiding this comment

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

While you are on this file... it looks like nothing calls the private methodaddResource, so maybe you can remove theresources property of that class, as well as the loop "below".

Copy link
Member

Choose a reason for hiding this comment

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

sure. But the loop below happens inside->build() and so the subcollectionwill have the resources in it if it has any.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

But it’s not the case (the new test fail without my patch). I’ll Investigate this afternoon.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I double checked and pushed a better fix:

$route can have resources but no routes. So the loop over$this->resources must be outside the loop on$this->routes.

Can you check if it's ok@stof?

@fabpot
Copy link
Member

Thank you@dunglas.

fabpot added a commit that referenced this pull requestOct 20, 2017
This PR was squashed before being merged into the 2.8 branch (closes#24642).Discussion----------[Routing] Fix resource miss| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks?    | no| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->| Tests pass?   | yes| Fixed tickets | n/a| License       | MIT| Doc PR        | n/aSome routing resources are not watched. To reproduce:1. Install Symfony 42. Change something in `config/routes.yaml`The change is not taken into account.This PR fixes this bug.Commits-------6610c25 [Routing] Fix resource miss
@fabpotfabpot closed thisOct 20, 2017
This was referencedOct 30, 2017
This was referencedNov 10, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@TobionTobionAwaiting requested review from Tobion

+1 more reviewer

@srozesrozesroze left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

2.8

Development

Successfully merging this pull request may close these issues.

6 participants

@dunglas@fabpot@nicolas-grekas@stof@sroze@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp