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

Prismic::SearchForm url parameters are not correctly separated #157

Closed
damyanovg opened this issue Jul 26, 2018 · 5 comments
Closed

Prismic::SearchForm url parameters are not correctly separated #157

damyanovg opened this issue Jul 26, 2018 · 5 comments

Comments

@damyanovg
Copy link

https://github.com/prismicio/php-kit/blob/5670c79a639c09b96ad9460592713fad3a7f777d/src/Prismic/SearchForm.php#L265

Example options:
['pageSize' => 2, 'page' => 2] they are not separated correctly and the reason the response is incorrect.

With '?' as a separator the url looks like this:
...?page=1&pageSize=100&...

Once the question mark is changed to '&' the parameters are correctly separated:
...&page=1&pageSize=100&...

@c0nst4ntin
Copy link
Collaborator

@damyanovg Could you maybe provide me with a little code example of where this problem appeared to you? I am currently trying to go through all the Issues and PRs on this project to attempt to get things back on track.

@gsteel
Copy link
Contributor

gsteel commented Nov 21, 2022

If you are using the integration fields feature, your api url will typically already contain query parameters such as …/prismic-endpoint?integration-field-stuff=whatever. This lib just appends ?new-query-params to the configured api url without first checking for an existing query - at least it used to. At the least there needs to be a unit test that covers an api url with pre-configured query params.

@c0nst4ntin
Copy link
Collaborator

I'll Look into this a bit more tomorrow. But that was exactly the problem I was seeing as well

@c0nst4ntin
Copy link
Collaborator

Whilst there seems to be no automated test for this, it appears to be fixed: https://github.com/prismicio-community/php-kit/blob/master/src/Prismic/Utils.php#L10

Should I try to add a test for this? Or should we just close this issue?

@c0nst4ntin
Copy link
Collaborator

I will proceed to mark this as closed for now. If anybody runs into this problem again, please re-open it or start a new issue.

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

Successfully merging a pull request may close this issue.

3 participants