Skip to content

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

Conversation

simonhayre
Copy link

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

@javiereguiluz javiereguiluz changed the title 18035 fix for router doesnt take additional default values Fixed router doesn't take additional default values Mar 12, 2016
if (isset($defaults[$key]) &&
!array_key_exists($key, $variables) &&
$defaults[$key] !== $value
) {
Copy link
Contributor

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.

@jakzal
Copy link
Contributor

jakzal commented Mar 14, 2016

fixes #10940

@Alsatian67
Copy link

@simonhayre can you do the changes requested from jakzal ?

Thanks

@RawTech
Copy link

RawTech commented Mar 22, 2016

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing space after foreach

@Tobion
Copy link
Contributor

Tobion commented Mar 23, 2016

Replaced by #18280 which uses a different implementation and weak comparison on purpose. @simonhayre thanks for your work on this.

@Tobion Tobion closed this Mar 23, 2016
fabpot added a commit that referenced this pull request Apr 15, 2016
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants