Review 13.4 Merged

96095[BUGFIX] Respect uidInList order in database queries

Stefan Bürk CR +2 V +2 Normal +153 −1 updated 09/25/26, 20:30

Commit message

When `select.uidInList` is used without an explicit `orderBy`, the
records are now sorted by the position of their uid in the list,
using a portable `CASE` expression, instead of the undefined order
returned by the database. Sorting happens in SQL, so the order is
kept when `max` and `begin` are used.

In workspace previews, move pointers are sorted at the position of
their live record. An explicit `orderBy` still takes precedence,
and no sorting is added for `groupBy`, `DISTINCT` or aggregate select
fields, as this is invalid SQL on some database platforms.

The `CASE` expression is assembled manually for now and a `@todo`
marks it for a dedicated `ExpressionBuilder` method in a follow-up.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 1

Files 2

Review log 34

  1. Stefan Bürk uploaded patch set 1 09/25/26, 20:12

  2. core-ci voted on patch set 1 V +1 09/25/26, 20:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109303

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 09/25/26, 20:30

  4. Stefan Bürk merged patch set 2 09/25/26, 20:30