Skip to content

[Routing] Add matched and default parameters to redirect responses #19037

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

Closed

Conversation

Tobion
Copy link
Contributor

@Tobion Tobion commented Jun 12, 2016

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #18012
License MIT
Doc PR

Finished #18012

@fabpot
Copy link
Member

fabpot commented Jun 13, 2016

Tests do not pass.


return $this->redirect($pathinfo.'/', null);
return array_replace($parameters, $this->redirect($pathinfo.'/', isset($parameters['_route']) ? $parameters['_route'] : null));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Passing the _route to the redirect method makes the tests fail in the FrameworkBundle: https://github.com/symfony/symfony/pull/19037/files#diff-7b7153654c7ee1d563e8421f3f9be20e

I could extract this fix as a bugfix as the current behavior is not consistent with the dumped matcher, see https://github.com/symfony/symfony/pull/19037/files#diff-3b72491a9ba1cff58442b845ae837eb3L292 which passed the route name as second argument to redirect.

But I don't know how to fix the frameworkbundle test which will also be run against the lowest allowed routing version, right? So I need to increase the routing dependency in https://github.com/symfony/symfony/blob/2.7/src/Symfony/Bundle/FrameworkBundle/composer.json#L28 but to a version that is not released yet?

Copy link
Member

Choose a reason for hiding this comment

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

right, @nicolas-grekas can you help @Tobion with the best composer changes to do here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nicolas-grekas I could still use your help here

Copy link
Member

Choose a reason for hiding this comment

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

to a version that is not released yet

yes, that works, wouldn't be the first time

Copy link
Contributor Author

@Tobion Tobion Oct 31, 2016

Choose a reason for hiding this comment

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

So "symfony/routing": "~2.7.21|~2.8.14|^3.1.7"? I don't see how composer will know to install the latest 2.7 branch then as 2.7.21 is not released yet. And even if it does, when the PR is not merged yet, the fix won't be installed. Thus the tests cannot pass before they are merged?

Copy link
Member

@nicolas-grekas nicolas-grekas Nov 9, 2016

Choose a reason for hiding this comment

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

Sorry, late answer. Yes, it will work, composer will know thanks to the branch-alias in composer.json

Copy link
Member

@nicolas-grekas nicolas-grekas Nov 9, 2016

Choose a reason for hiding this comment

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

The PR doesn't need to be merged: a local composer repository is made on travis to simulate the merge before it really happens. See .github/build-packages.php

@nicolas-grekas nicolas-grekas added this to the 3.x milestone Dec 6, 2016
@fabpot
Copy link
Member

fabpot commented Mar 22, 2017

@Tobion Can you finish this one?

@nicolas-grekas
Copy link
Member

@Tobion since I could not push on your fork, I opened #23440 which rebases this on 3.4. Can you please tell me if it's OK for you?

nicolas-grekas added a commit that referenced this pull request Jul 11, 2017
…ct responses (artursvonda, Tobion)

This PR was merged into the 3.4 branch.

Discussion
----------

[Routing] Add matched and default parameters to redirect responses

| Q | A |
| --- | --- |
| Branch? | master |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #18012, #19037 |
| License | MIT |
| Doc PR |  |

Finished #18012 and #19037

Commits
-------

4c1fdd4 [Routing] also add matched params for redirect due to trailing slash
dc3f7a9 [Routing] Add matched and default parameters to redirect responses
@Tobion Tobion deleted the bugfix-add-matched-params-to-redirect branch September 28, 2017 13:25
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.

5 participants