-
Notifications
You must be signed in to change notification settings - Fork 63
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
Forcing two fields to sort numerically with a filter doesn't work #1759
Labels
Comments
rafaehlers
changed the title
Forcing two fields to sorting numerically with a filter doesn't work
Forcing two fields to sort numerically with a filter doesn't work
Oct 19, 2022
mrcasual
added a commit
that referenced
this issue
Aug 27, 2024
This allows for more granular control of sorting parameters for each when fetching View entries.
mrcasual
added a commit
that referenced
this issue
Aug 27, 2024
This allows for more granular control of sorting parameters for each when fetching View entries.
mrcasual
added a commit
that referenced
this issue
Aug 28, 2024
This implements #1759. To test, use this filter: ``` add_filter( 'gk/gravityview/view/entries/query/sorting-parameters', function ( $params ) { foreach ( $params as &$field ) { $field['is_numeric'] = true; } return $params; } ); ``` [GravityMigrate data](https://github.com/user-attachments/files/16765603/gk-migrate-debug.try.gravitykit.com-2024-08-26-1724694417.zip). 💾 [Build file](https://www.dropbox.com/scl/fi/5ik2t3mr6pk8lx4m91wg5/gravityview-2.27.1-81f6fa655.zip?rlkey=35eq2s9hyesjukmd0lsrvrp4n&dl=1) (81f6fa6).
This is now working. Doc updated with the new filter: https://docs.gravitykit.com/article/112-forcing-numbers-to-sort-properly Customer notified ✅ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The only way at this moment (GV 2.15) to force text-based fields to force as they were numbers is by using the following filter:
This filter works as proved here: https://debug.try.gravitykit.com/view/drop-down-sorting-test/?cache
However, it doesn't work when setting sort on a secondary field:
Related: https://docs.gravitykit.com/article/112-forcing-numbers-to-sort-properly
gk-migrate-debug.try.gravitykit.com-2024-08-26-1724694417.zip
The text was updated successfully, but these errors were encountered: