Skip to content

Fix: File sorting by name in the explorer table and tree#825

Open
davcorrom wants to merge 1 commit intoalkacon:masterfrom
davcorrom:fix/file-sorting-20251021
Open

Fix: File sorting by name in the explorer table and tree#825
davcorrom wants to merge 1 commit intoalkacon:masterfrom
davcorrom:fix/file-sorting-20251021

Conversation

@davcorrom
Copy link
Contributor

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.

image

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.

image

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.

image

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.

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

Successfully merging this pull request may close these issues.

1 participant

Comments