Skip to content
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

Query option breaks BC if one doesn't use it #39

Closed
nikita2206 opened this issue Apr 18, 2016 · 4 comments
Closed

Query option breaks BC if one doesn't use it #39

nikita2206 opened this issue Apr 18, 2016 · 4 comments
Assignees
Labels

Comments

@nikita2206
Copy link

nikita2206 commented Apr 18, 2016

Apparently commit d79f2fc (in version 4.5.0) indirectly broke a simple use case when not using this option at all.

If you try to pass a $uri to the Client#request() method (or any of the request family for that matter) which contains query, Guzzle will disregard it and instead it will use query from the $options array. Even though we didn't put query in the $options array, GuzzleBundle put it in the default options array (or default config - Client constructor's first argument) as an empty array() (because symfony configuration component provides default value if one is not present) and after guzzle merges $options with $this->config it now has a query element.

Should be easy to fix in GuzzleExtension by unsetting query from $options array after line 54 if it is an empty array.

@yoedumar
Copy link

I had the same issue after update to 4.5.0
Rewrite all my client->get($uri) where $uri had a query string (/api?someparam=value) with client->get($uriWithoutQueryString, array('query' => array('someparam' => 'value')));

@florianpreusner
Copy link
Member

florianpreusner commented Apr 21, 2016

Okay, that's a bug, cause it was not planned to change the behavior. Will check that later.

@derrabus
Copy link
Contributor

We just ran into the same regression. For now, we rolled back to v4.4.1, which worked fine for us.

@florianpreusner
Copy link
Member

Released new version: https://github.com/8p/GuzzleBundle/releases/tag/v4.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants