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

fix count with sort param #7159

Merged
merged 1 commit into from Jul 24, 2020
Merged

fix count with sort param #7159

merged 1 commit into from Jul 24, 2020

Conversation

petersg83
Copy link
Contributor

fix #7138

Signed-off-by: Pierre Noël <petersg83@gmail.com>
Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexandrebodin alexandrebodin added this to the 3.1.2 milestone Jul 24, 2020
@alexandrebodin alexandrebodin added source: core:database Source is core/database package issue: bug Issue reporting a bug labels Jul 24, 2020
@alexandrebodin alexandrebodin merged commit ab77f26 into master Jul 24, 2020
@alexandrebodin alexandrebodin deleted the fix/sortAndQuery branch July 24, 2020 13:11
@robclouth
Copy link

I'm pretty sure normal search is broken too. Don't you need to change this line too?

const filters = convertRestQueryParams(_.omit(params, '_q'));

@petersg83
Copy link
Contributor Author

The problem was that the query was doing a sort on a count(*), which has not any sense. So we remove the sort parameter when doing a count(*).
When doing a search, the sort parameter has sense and, I think, should not be removed. So I think there is no need to change this line. But if you find a usecase where it doesn't work, I'll be happy to look into it !

@robclouth
Copy link

You're right. Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug source: core:database Source is core/database package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trying to search within a content type seems to be broken in 3.1.0.
3 participants