Issue Bug Resolved

#110682Filelist: changing the sort field resets the sort direction to ascending

Amir Arends 09/11/26, 19:36 updated 09/15/26, 05:50

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

  1. Open the backend module File > Filelist and select a folder with several files.
  2. 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.
  3. In the same dropdown, now switch the sort field (e.g. from “Name” to “Size”).
  4. Expected: the list is sorted by the new field, still descending.
  5. Actual: the list jumps back to ascending order. The URL of the sort field buttons contains sortDirection=1.

Reviews 2

History 14

  1. Amir Arends commented and changed status Under Review Resolved done 0 % 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.