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 route URL generation in CLI context#31023

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

@X-Coder264
Copy link
Contributor

@X-Coder264X-Coder264 commentedApr 8, 2019
edited
Loading

QA
Branch?4.2
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#30996
LicenseMIT
Doc PR-

Thisfixes#30996 and makes URL generation in the CLI context behave the same as it does in the web context where theLocaleListener sets the default locale (to the router context).

The Travis CI failure is related to the fact that the constraint forsymfony/routing should be bumped to^4.2.6 in the composer.json of the FrameworkBundle (when it gets tagged).

maxhelias reacted with heart emoji
@nicolas-grekas
Copy link
Member

the constraint for symfony/routing should be bumped to ^4.2.6 in the composer.json

please do it in this PR

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.

with minor comments

@X-Coder264X-Coder264force-pushed thefix-route-url-generation-in-cli branch 2 times, most recently fromb9e3d03 to2cea5b6CompareApril 8, 2019 21:07
@nicolas-grekas
Copy link
Member

Tests will be green once the patch is merged up to master.

@fancyweb
Copy link
Contributor

I just tested the case I described in the linked ticket, and it does behave like I wrote it so this change could technically break someone workflow.

@nicolas-grekas
Copy link
Member

@fancyweb the scenario you describe would apply to the cli but not to the web, right? Having a consistent behavior looks more important to me that preserving a non-consistent one to me. Makes sense?

@fancyweb
Copy link
Contributor

It also applies to the web context but I guess it's very unlikely that someone relies on this behavior.

@fabpotfabpotforce-pushed thefix-route-url-generation-in-cli branch from2cea5b6 to4a1ad4aCompareApril 22, 2019 09:10
@fabpot
Copy link
Member

Thank you@X-Coder264.

@fabpotfabpot merged commit4a1ad4a intosymfony:4.2Apr 22, 2019
fabpot added a commit that referenced this pull requestApr 22, 2019
…264)This PR was squashed before being merged into the 4.2 branch (closes#31023).Discussion----------[Routing] Fix route URL generation in CLI context| Q             | A| ------------- | ---| Branch?       | 4.2| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#30996| License       | MIT| Doc PR        | -Thisfixes#30996 and makes URL generation in the CLI context behave the same as it does in the web context where the `LocaleListener` sets the default locale (to the router context).The Travis CI failure is related to the fact that the constraint for `symfony/routing` should be bumped to `^4.2.6` in the composer.json of the FrameworkBundle (when it gets tagged).Commits-------4a1ad4a [Routing] Fix route URL generation in CLI context
@X-Coder264X-Coder264 deleted the fix-route-url-generation-in-cli branchApril 22, 2019 09:20
@X-Coder264
Copy link
ContributorAuthor

X-Coder264 commentedApr 22, 2019
edited
Loading

Thanks for the merge. Thesymfony/routing constraint forFrameworkBundle should be bumped now from^4.2.6 to^4.2.8 since 4.2.6 and 4.2.7 were already released since this PR was opened.

@fabpot
Copy link
Member

@X-Coder264 Thanks for the followup, fixed ine479b69

X-Coder264 reacted with thumbs up emoji

nicolas-grekas added a commit that referenced this pull requestNov 4, 2019
…eMC)This PR was merged into the 4.3 branch.Discussion----------[Routing] Fix URL generator instantiation| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | yes| New feature?  | no| Deprecations? | no| License       | MITAfter merging my fix (PR#31023) from the 4.2 branch to 4.3 (which was master at the time) one code path which instantiates the url generator was missed. This new code path was added via#28865 and was missed during the merge because there was no merge conflict there as that code path didn't exist on 4.2.So the current state on the 4.3 branch is:-https://github.com/symfony/symfony/blob/v4.3.5/src/Symfony/Component/Routing/Router.php#L356 (default locale is properly passed to the constructor)-https://github.com/symfony/symfony/blob/v4.3.5/src/Symfony/Component/Routing/Router.php#L372 (default locale is **NOT** properly passed to the constructor)-https://github.com/symfony/symfony/blob/v4.3.5/src/Symfony/Component/Routing/Router.php#L378 (default locale is properly passed to the constructor)I noticed this in my app because tests started to fail on the branch where we are upgrading our app from SF 4.2 to 4.3 due to this. This PR fixes the inconsistency (now the default locale is passed on all three places) which fixes the bug.Commits-------9aa66e2 Add tests to ensure defaultLocale is properly passed to the URL generator16c9baf Fix URL generator instantiation
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

+1 more reviewer

@maxheliasmaxheliasmaxhelias approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

6 participants

@X-Coder264@nicolas-grekas@fancyweb@fabpot@maxhelias@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp