-
-
Notifications
You must be signed in to change notification settings - Fork 907
Ensure that OrderFilter preserves the query string parameters order #1710
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
Ensure that OrderFilter preserves the query string parameters order #1710
Conversation
8c3f4ae
to
fb7cc47
Compare
I'm definitely not a fan of the code duplication that it generates and I'm open to any other option. |
@@ -300,6 +300,67 @@ Feature: Order filter on collections | |||
} | |||
""" | |||
|
|||
Scenario: Get collection ordered collection on several property keep the order |
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.
@dunglas Should I open a MR to add this test to 2.1 also ?
Shouldn't that be fixed in symfony then? If not then 👍 |
It should be fixed in SF, but we need a workaround in the meantime. |
I'll open a PR to symfony also @soyuka and remove this when an upsteam patch will be availlable. I also don't know in which version of symfony it will end in (if it does get merged), and it might force to pin to a higher version than today which can also not be acceptable for this projet... |
Thanks @antograssiot |
@soyuka @dunglas I gave a try to allow that in symfony directly as promised. |
…-in-filters Ensure that OrderFilter preserves the query string parameters order
When requesting the API with a url like
/foo?order[baz]=asc&order[bar]=asc
the order is not preserved anymore as it used to be since 1.0The root cause is the Symfony
Request::getQueryString()
not preserving the order when re-generating the string.For now I've ported the Symfony function and removed the sorting thing for now.