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] 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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
d005c8f to6faae44CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas commentedApr 8, 2019
please do it in this PR |
src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
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.
with minor comments
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
b9e3d03 to2cea5b6Comparenicolas-grekas commentedApr 8, 2019
Tests will be green once the patch is merged up to master. |
fancyweb commentedApr 9, 2019
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 commentedApr 15, 2019
@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 commentedApr 15, 2019
It also applies to the web context but I guess it's very unlikely that someone relies on this behavior. |
2cea5b6 to4a1ad4aComparefabpot commentedApr 22, 2019
Thank you@X-Coder264. |
…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-Coder264 commentedApr 22, 2019 • 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.
Thanks for the merge. The |
fabpot commentedApr 22, 2019
@X-Coder264 Thanks for the followup, fixed ine479b69 |
…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
Uh oh!
There was an error while loading.Please reload this page.
Thisfixes#30996 and makes URL generation in the CLI context behave the same as it does in the web context where the
LocaleListenersets the default locale (to the router context).The Travis CI failure is related to the fact that the constraint for
symfony/routingshould be bumped to^4.2.6in the composer.json of the FrameworkBundle (when it gets tagged).