Issue Bug Closed

#103053Search and sorting in file list not working properly

Kai Strecker 02/05/24, 15:04 updated 07/09/24, 15:12

Description

Bug 1: Search query is lost when changing sorting

Steps to reproduce

  1. Open file list in backend.
  2. Switch the view from “Tiles” to “List”.
  3. Search for example for “jpg”.
  4. Click on one of the column labels to change the sorting.

=> The search query is lost.

The same thing happens, if you click on the forward or backward pagination link at step 3.

Bug 2: Sorting by file size does not work

Also, sorting by file size does not work properly. This is, because the comparison is done with the “Collator” php class: https://github.com/TYPO3/typo3/blob/v12.4.10/typo3/sysext/filelist/Classes/FileList.php#L1556
The sorting is wrong, because the collator is not doing a natural numeric comparison. In my opinion, this can be fixed by adding this line:

$collator->setAttribute(\Collator::NUMERIC_COLLATION, \Collator::ON);

But maybe this should only be done, when sorting by file size? I am not sure, what other side effects this change would introduce…

Reviews 2

History 37

  1. Gerrit Code Review pushed patch set 1 for main to change 82826 status New Under Review 02/06/24, 16:13

  2. Daniel Siepmann changed Related to #103080 02/08/24, 09:48

  3. Gerrit Code Review pushed patch set 2 for main to change 82826 02/09/24, 17:09

  4. Gerrit Code Review pushed patch set 3 for main to change 82826 02/09/24, 17:27

  5. Gerrit Code Review pushed patch set 1 for 12.4 to change 82850 02/12/24, 15:11

  6. Oliver Bartsch commented and changed status Under Review Resolved done 0 % 100 % 02/12/24, 15:35

    Applied in changeset commit:b0f4191048ac0ba2bda96411d7da469c83b9b2fd.

  7. Benni Mack changed status Resolved Closed 07/09/24, 15:12