Review main Ready for review Quiet

97262[BUGFIX] Sort workspace module by page tree order and label

Georg Ringer CR 0 V 0 Easy +34 −2 updated 11/03/26, 19:05

Commit message

Sorting of the workspace module list got lost when the condition of
sortDataArray() was inverted during a refactoring, which later led to
the removal of the method as being useless. Records have since been
listed in TCA table order, unrelated to the page tree.

Records are now sorted by the page tree order and their label again,
before the dependency resolving and the pagination take place. The
page tree order is built from the sorting values of all pages in the
rootline, as the sorting of a page is only comparable among its
siblings. Missing values added by event listeners are treated as empty.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 2
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/62/97262/2 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/62/97262/2 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Merge conflicts 3

Issues 3

Files 4

Review log 57

  1. Georg Ringer uploaded patch set 1 10/31/26, 14:50

  2. Georg Ringer commented on patch set 1 10/31/26, 14:51

    This change is ready for review.
  3. core-ci voted on patch set 1 V +1 10/31/26, 15:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112962

  4. Oli Bartsch commented on patch set 1 11/01/26, 17:25

    GridDataService.php:481

    Sorting by `path_Workspace` orders sibling pages by title, not by `pages.sorting`, and equally named siblings share a path, so their records get mixed under one header. This matches the 13.4.8 behaviour, so it would be fine for this bugfix but we might consider switching to a rootline-based sorting key, which could give real page tree order.

    GridDataService.php:569

    The comparator passes `path_Workspace` and `label_Workspace` straight to `strcasecmp()`. Rows can be added or changed by listeners of `AfterCompiledCacheableDataForWorkspaceEvent` and `AfterDataGeneratedForWorkspaceEvent`, so a missing key or `null` would throw a `TypeError` under `strict_types`. Please compare `(string)($a['path_Workspace'] ?? '')` and `(string)($a['label_Workspace'] ?? '')` instead, like the surrounding code does with `??` defaults.
  5. Georg Ringer uploaded patch set 2 V +1 11/03/26, 18:55

  6. Georg Ringer commented on patch set 2 11/03/26, 18:56

    GridDataService.php:481 Reply

    Done

    GridDataService.php:569 Reply

    Done
  7. core-ci voted on patch set 2 V +1 11/03/26, 19:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113204