#110682Filelist: changing the sort field resets the sort direction to ascending
Description
The sorting dropdown of the file list writes an integer into the sortDirection URL parameter, although SortDirection is a string backed enum. The resulting value is not a valid enum case, so it is silently discarded on the next request and the list falls back to ascending order.
FileListController.php
$sortingModeButtons[] = $this->componentFactory->createDropDownRadio()
->setActive($this->filelist->sortField === $field)
->setHref($this->filelist->createModuleUri([
'sortField' => $field,
'currentPage' => 0,
'sortDirection' => (int)($this->filelist->sortDirection === SortDirection::DESCENDING),
]))
->setLabel($label);
Steps to reproduce
- Open the backend module File > Filelist and select a folder with several files.
- Open the “Sorting” dropdown in the doc header and choose “Descending”. The list is sorted descending. This works, because that button uses
SortDirection::DESCENDING->value. - In the same dropdown, now switch the sort field (e.g. from “Name” to “Size”).
- Expected: the list is sorted by the new field, still descending.
- Actual: the list jumps back to ascending order. The URL of the sort field buttons contains
sortDirection=1.
Reviews 2
History 14
-
Gerrit Code Review pushed patch set 1 for main to change 95774 status
NewUnder Review <span data-processor="relativetime" data-value="2026-09-11T19:39:58+00:00" > 09/11/26, 19:39 </span> -
Gerrit Code Review pushed patch set 2 for main to change 95774 <span data-processor="relativetime" data-value="2026-09-14T06:47:42+00:00" > 09/14/26, 06:47 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 95833 <span data-processor="relativetime" data-value="2026-09-15T05:48:55+00:00" > 09/15/26, 05:48 </span>
-
Amir Arends commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-09-15T05:50:09+00:00" > 09/15/26, 05:50 </span>
Applied in changeset commit:85a4d33940470afb8f8fbe9344d2dd6b93c5f251.