-
-
Notifications
You must be signed in to change notification settings - Fork 533
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
[4.x] Remove duplication of code in search:results tag, and treat pagination params as integer types #8314
Conversation
I don't quite understand what issue this is fixing. Could you explain some more? The search results tag seems to work fine without this PR. Maybe it's something specific with your setup. |
I probably haven't given enough detail. So I'm trying to get things in place for: https://github.com/thoughtco/statamic-zinc-search The query builder I wrote for it is returning a Statamic\Search\Result for each result, so that it works in the control panel. When trying to use the same on the search:results tag that became an issue. Am I wrong in thinking the same results should work in both places? |
The current built-in search query builder used in the Could you provide an example repo showing whatever it is that's broken without this PR? |
Yeah I'll pull something together tomorrow. I would still like the pagination params to be ints :) |
The int params part is fine 👍 |
Ok, I forgot to handle the conversion of items to results in my get() method, sorry for totally wasting your time on that bit. |
Thanks for updating it. It looks simple enough, but need to check how it behaves when you do |
Is that not already being handled by setPaginationParameterPrecedence() So we can safely expect paginate to be an int at the point I changed it? |
You're probably right but I'm kinda just making a note for when I get back to review this in depth. |
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.
There are a couple of small things I noticed about search, like you have to provide a limit
if you do paginate="true"
, which is a bit unexpected.
Anyway, it was like that before the PR too. What you've added doesn't change any behavior.
Thanks!
Great. I feel like that should just be clarified in the docs? |
Still prefer to guide people to just do |
When working on the zinc search integration I noticed the search:results tag wasn't handling Search/Result being returned by the search index, so this updates it.
I also took the opportunity to ensure pagination params were treated as
int
, instead of treating them as strings.