-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Fixed router doesn't take additional default values #18111
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
Fixed router doesn't take additional default values #18111
Conversation
simonhayre
commented
Mar 11, 2016
Q | A |
---|---|
Branch | 2.3 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | Yes |
Fixed tickets | #18035 |
License | MIT |
Doc PR |
… default is provided
… default is provided
… default is provided
… default is provided
… default is provided
… default is provided
… default is provided
… default is provided
… default is provided
… default is provided
…ues' of github.com:simonhayre/symfony into 18035-fix-for-router-doesnt-take-additional-default-values
if (isset($defaults[$key]) && | ||
!array_key_exists($key, $variables) && | ||
$defaults[$key] !== $value | ||
) { |
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.
Can you put the condition in a single line please? It would be more consistent with rest of the code base.
fixes #10940 |
@simonhayre can you do the changes requested from jakzal ? Thanks |
Changes look good @simonhayre but you'll need to make the change that @jakzal proposed to be consistent with the rest of the class. |
@@ -258,6 +258,11 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa | |||
|
|||
// add a query string if needed | |||
$extra = array_diff_key($parameters, $variables, $defaults); | |||
foreach($parameters as $key => $value) { |
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.
missing space after foreach
Replaced by #18280 which uses a different implementation and weak comparison on purpose. @simonhayre thanks for your work on this. |
…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