-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] add query param if value is different from default #18280
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
[Routing] add query param if value is different from default #18280
Conversation
Tobion
commented
Mar 23, 2016
Q | A |
---|---|
Branch? | 2.3 |
Bug fix? | yes |
New feature? | yes |
BC breaks? | most likely not |
Deprecations? | no |
Tests pass? | no |
Fixed tickets | #10940, #18111, #18035 |
License | MIT |
Doc PR | - |
I hope this does not break the i18n routing bundle tests contrary to before (see #6814 and https://travis-ci.org/schmittjoh/JMSI18nRoutingBundle/jobs/3229075). |
Thank you @Tobion. |
…lt (Tobion) This PR was merged into the 2.3 branch. Discussion ---------- [Routing] add query param if value is different from default | Q | A | ------------- | --- | Branch? | 2.3 | Bug fix? | yes | New feature? | yes | BC breaks? | most likely not | Deprecations? | no | Tests pass? | no | Fixed tickets | #10940, #18111, #18035 | License | MIT | Doc PR | - Commits ------- 1ef2edf [Routing] add query param if value is different from default
This is a BC break, I'm afraid. If you had not removed lines 296 and 297 of the public function testQueryParamSameAsDefault()
{
$routes = $this->getRoutes('test', new Route('/test', array('default' => 'value')));
$this->assertSame('/app.php/test', $this->getGenerator($routes)->generate('test', array('default' => 'foo')));
$this->assertSame('/app.php/test', $this->getGenerator($routes)->generate('test', array('default' => 'value'))); We have relied on the first assertion being true in Contao, which is now no longer the case. |
What is your use-case for this behavior? |
Our use case is pretty much what is in the first deleted assertion. We want the router to ignore the But actually the use-case should not matter. The changes affect the API in an incompatible way, which the deleted assertions would have shown if not removed. :) |
Also, I'm not implying that ignoring the Still the router now behaves differently than in Symfony 3.0.4. |
…ms (xabbuh) This PR was merged into the 3.2-dev branch. Discussion ---------- [Routing] treat fragment after resolving query string params | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | The implementation from #12979 led to a conflict with #18280 which was merged in the meantime. Commits ------- 7475aa8 treat fragment after resolving query string params