Use locale-aware collation for attendee list sorting#1663
Open
dd32 wants to merge 2 commits intoproductionfrom
Open
Use locale-aware collation for attendee list sorting#1663dd32 wants to merge 2 commits intoproductionfrom
dd32 wants to merge 2 commits intoproductionfrom
Conversation
The camptix_attendees shortcode sorts by post_title using the default database collation (utf8mb4_unicode_ci), which uses older Unicode 4.0 sorting rules. This causes characters like Polish Ł to sort incorrectly, appearing after Z instead of with L. Add a posts_orderby filter to use utf8mb4_unicode_520_ci collation when sorting by title, and set suppress_filters to false so the filter runs. Fixes #1310 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
utf8mb4_unicode_520_cicollation to the ORDER BY clause when the[camptix_attendees]shortcode sorts by titleutf8mb4_unicode_cicollation uses Unicode 4.0 sorting rules, which incorrectly sorts characters like Polish Ł (after Z instead of with L)posts_orderbyfilter withsuppress_filters => falseas discussed in the issue comments by @dd32 and @pkevanChanges
camptix/addons/shortcodes.php: Addedsuppress_filters => falsetoget_posts()args, and a temporaryposts_orderbyfilter that adds the COLLATE clause when sorting by titleImplementation details
orderbyistitle(the default)SELECT post_title FROM wc_posts WHERE post_type = 'tix_attendee' ORDER BY post_title COLLATE 'utf8mb4_unicode_520_ci' ASCproduces correct sortingTest plan
Fixes #1310
🤖 Generated with Claude Code