-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Undocumented BC break in Routing #6814
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't see what could have changed the behavior for this PR in 2.2. And I'm not really sure what this PR solves. |
yeah, a failing testcase would probably help to understand the issue, but the PR does not seem to add one |
That PR fixes 4 test cases instead of breaking them, see bundle build results before it: https://travis-ci.org/schmittjoh/JMSI18nRoutingBundle/jobs/3229075 The tests started failing immediately after switching to symfony 2.2: https://travis-ci.org/schmittjoh/JMSI18nRoutingBundle/builds |
@kachkaev I'm talking about failing testcases for the routing component showing the BC breaks |
I think it would make more sense if @Tobion, or someone familar with the changes that were made to the routing component takes a look. The bundle has not changed, and you can run its unit tests or even copy them to the core component if you like to see the regression. |
I've been investigating the above mentioned JMSI18nRoutingBundle issue, and I believe I found the possible source of the problem: symfony/routing@c66d1f9#diff-0 It think the problem is on the UrlGenerator class:
Reverting the change to this line and recreating the $originParameters like it was before this commit seem to solve the issue with JMSI18nRoutingBundle. Of course that this doesn't mean that @Tobion commit is to blame, but it was all I could come up with. Hope it helps |
@Tobion any thoughts? |
@tiagojsag is right. This commit changed the behavior. But IMO it's a bug fix as the added test there shows:
Previously the |
Athough I agree that test proves the bug...some of us used it as a feature, it was useful to tag routes. For example I have some controllers that display product lists and all those methods had a defaults: {list: true} to flag them and then do some common things on a RequestListener. Maybe not the better option, but it worked :p @Tobion I also think that this should be made explicit in the changelog, the distinction between bug/feature is not very clear on this one. |
@Tobion, was there a practical use-case that you fixed here? The example with "page" is pretty common, but never caused any problems for me with the old system. Probably, because "page" is a query parameter anyway and you do not rely on the routing system there. In general, having a route placeholder and a query parameter with the same name seems like an edge case to me. If this is more a theoretical fix, then I think we should roll back for now until we have found a good upgrade path because there does not seem to be one yet. It seems more that the defaults array is used for used for multiple purposes, and we might need to split it into different arrays with more specific meanings. |
@fabpot, could you share your view/make a decision on this one? Basically, we have a behavior change on a method tagged with If this is not reverted, then I'd love to see some documented upgrade path which at the moment is not available unfortunately. |
I've created a pull request which makes viewing the change in question a bit easier. |
This PR was merged into the 2.2 branch. Discussion ---------- Reverts behavior change to UrlGenerator I do not want to talk much about the behavior change and whether it makes sense or not because I think it does not matter in this situation anyway. The ``generate`` method is tagged with ``@api``, there is no security issue that was fixed. According to the rules set forth at http://symfony.com/doc/current/book/stable_api.html, the semantics of such a method must not be changed. There is some more discussion in #6814 and the commit changing the behavior is this one: symfony/routing@c66d1f9#diff-0 Commits ------- a765375 reverts some behavior changes made in c66d1f9de30fd1b6a86cca10dd79d12c9ba9ff25
Someone submitted a patch for JMSI18nRoutingBundle to make the bundle compatible with Symfony 2.2. After reading through the upgrade file, I couldn't find any mention of this change though.
So, the question is whether this was actually an intended BC break which is just not documented, or an unintentional BC break?
see schmittjoh/JMSI18nRoutingBundle#80
The text was updated successfully, but these errors were encountered: