-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fixed EZP-31630: error when running location query #37
base: 1.0
Are you sure you want to change the base?
Conversation
2534880
to
3079d62
Compare
@michal-myszka any idea why Travis won't run ? |
@mnocon is the right person here 😉 |
Oops, thank you @adamwojs :) P.S. does travis run when you change a PR from draft to non-draft ? |
Not sure what happened here, here's what I can tell:
As far as I know Travis usually builds draft PRs, but maybe there were conflicts between this PR and master? This would stop the build from triggering. Changing the base branch (from master to 1.0) does not trigger a build, so no change here. Can you try to trigger the build again, so that the base change is taken into account? Then we will see what happens (you have to do it by git, something like |
Oh, yes, I also rebased the branch against 1.0 and pushed it, I guess that's when it didn't run. Thank you ! |
Resolved by testing the type of the returned Query object, executing the applicable SearchService method, and filtering to only return content.
3079d62
to
564b15f
Compare
Okay, we are green now, ready for QA. |
We have an issue here: if an item has several locations that match the criteria, the result set will contain the same content item several times. I'm considering adding a filter during the iteration to prevent that, and only return the first occurrence of each content item. But the second problem is pagination... What do you think, @adamwojs ? :) |
So you're approving despite the issue, @adamwojs ? :) |
Sorry, I missed somehow your comment. I see the following options here
or introduce location-query field type |
This is what this PR does, with the consequences explained above.
I think it won't be satisfactory for users, as the results will be very unpredictable. For I need to think about it some more... but it feels likely that we will need to evolve queries and query types in general to do this right. |
This might be the most agile option out of all of them. It doesn't make everything possible, but it fixes it for main locations, at least. |
One more kinda related thing about content / location queries: I think that we should push the concept of location to a "secondary" feature, so that content items, their type and fields are the first citizen of our API. Do you see the idea, @adamwojs ? |
@bdunogier we need a rebase here |
1.x
and2.x
When a QueryType returns a LocationQuery that uses Location specific criteria, execution will fail since
findContent
is always used.Resolved by testing the type of the returned Query object, and executing with the applicable SearchService method. The results are still Content items, not locations.
TODO