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

[5.x]: Ordering by number still not fixed when using twig queries. #15973

Closed
leonwebcreators opened this issue Oct 29, 2024 · 3 comments
Closed
Assignees

Comments

@leonwebcreators
Copy link

What happened?
When ordering by a number field, the resulted order will be:
6
32
31
30
29
[...]

This query will result in the above wrong ordered list:
{% set entries = craft.entries().search('keyword').orderBy('number desc').all() %}

Ordering with another param works:
{% set entries = craft.entries().search('keyword').orderBy('weblink desc').all() %}

Expected behavior
Able to order by number in Twig

Actual behavior
Errors as above

Craft CMS version
5.4.9

PHP version
8.3

Operating system and version
No response

Database type and version
PostgreSQL 13/14/15/16

Image driver and version
No response

Installed plugins and versions
No response

Related errors (but this one was backend-only)
#15417

@i-just i-just self-assigned this Oct 29, 2024
@i-just
Copy link
Contributor

i-just commented Oct 29, 2024

Hi, thanks for reporting. I raised a PR for this.

@leonwebcreators
Copy link
Author

You lord, are a hero. Thanks!

@brandonkelly
Copy link
Member

Craft 5.4.10 is out with that fix. Thanks again!

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

No branches or pull requests

3 participants