Fix: File sorting by name in the explorer table and tree#825
Open
davcorrom wants to merge 1 commit intoalkacon:masterfrom
Open
Fix: File sorting by name in the explorer table and tree#825davcorrom wants to merge 1 commit intoalkacon:masterfrom
davcorrom wants to merge 1 commit intoalkacon:masterfrom
Conversation
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.
This pull request fixes the sorting of items by Name in the Explorer table and tree.
As shown in the image below, the issue was that sorting prioritized uppercase letters over lowercase ones.
This update makes the sorting case-insensitive, ensuring that items are ordered alphabetically by letter, regardless of case, as demonstrated in the following image with the fix applied.
The sorting behaviour is now consistent with the Title column, where case sensitivity is ignored and uppercase letters are not prioritized over lowercase ones. The image below shows the Title sorting working in the same way.
Regarding the tree view, sorting works correctly across all database engines except for MySQL, where uppercase letters are prioritized over lowercase ones, just like in the table.
To fix this, the following MySQL specific query has been added:
ORDER BY CMS${PROJECT}STRUCTURE.RESOURCE_PATH COLLATE UTF8MB4_GENERAL_CI
By adding the COLLATE clause, we ensure that sorting becomes case-insensitive, so uppercase and lowercase letters are treated equally.
Other database engines already handle sorting correctly and will continue using the generic query defined in the generic/query.properties file. For MySQL, however, this new query is defined in the mysql/query.properties file.
With this change, it is not neccessary to modify the table definitions in MySQL to include COLLATE clause. After the change, only the sorting behavior for resource paths in affected.