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 routing collection defaults when adding a new route to a collection#51704

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

Conversation

@bram123
Copy link
Contributor

QA
Branch?6.3
Bug fix?yes
New feature?no
Deprecations?no
Tickets~
LicenseMIT
Doc PR~

In our current Symfony project we use PHP routing files, and use routing collections that are setup before adding routes.

Before upgrading to Symfony 6.3 this meant we could add an attribute to the collection, add X routes and they would all have this routing attribute (be it stateless / methods / defaults). After upgrading to S6.3 this no longer works.

PR#49517 removed the createRoute method from the CollectionConfigurator, because it was thought to be unused, but this method was used when adding a new Route to a RouteCollection. Without the method, the createRoute method of the LocalizedRouteTrait was used.
This means that when setting up a route collection before adding routes, the new routes no longer get the collection settings.

Added a new unittest to prevent this from happening again. For now only added to the PhpFileLoaderTest, I don't know if this is also possible for XML/YML routing config to also add a test in those LoaderTests.

@bram123bram123 changed the titleFix routing collection defaults when adding a new route to a collection.[Routing] Fix routing collection defaults when adding a new route to a collection.Sep 20, 2023
@bram123
Copy link
ContributorAuthor

Test failures are (hopefully) unrelated; or did I do something wrong?

@nicolas-grekasnicolas-grekas changed the title[Routing] Fix routing collection defaults when adding a new route to a collection.[Routing] Fix routing collection defaults when adding a new route to a collectionSep 20, 2023
@nicolas-grekas
Copy link
Member

Good catch, thanks@bram123.

bram123 reacted with hooray emoji

@nicolas-grekasnicolas-grekas merged commit93afb42 intosymfony:6.3Sep 20, 2023
@bram123bram123 deleted the routing_collection_defaults branchSeptember 20, 2023 16:31
@nicolas-grekasnicolas-grekas modified the milestones:6.4,6.3Sep 25, 2023
@fabpotfabpot mentioned this pull requestSep 30, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@fancywebfancywebfancyweb approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

Projects

None yet

Milestone

6.3

Development

Successfully merging this pull request may close these issues.

3 participants

@bram123@nicolas-grekas@fancyweb

[8]ページ先頭

©2009-2025 Movatter.jp