Review main Merged

96807[BUGFIX] Overlay relations in the requested language after findByUid()

Alexander Schnitzler CR +2 V +2 Hard +259 −5 updated 11/09/26, 14:22

Commit message

With French as language, the fallback chain German, English and
overlays mixed or on, a record without a French translation but with
a German one is found by findByUid() and overlaid with its German
translation. Its relations to translatable records that have a French
translation are then returned in German instead of French.

The record API of core (RecordFactory) returns the French records for
the same record and language. Extbase returns the same records when
the parent is found by a query that respects the sys language.

The cause is that Backend::getObjectByIdentifier() sets
respectSysLanguage to false for the lookup. DataMapper::
getPreparedQuery() then replaces the requested language by the
language uid of the parent object, which is German after the fallback,
when it builds the query for the related records.

DataMapper::getPreparedQuery() now takes over the language of the
parent object only if the parent was not overlaid through the
requested language. If the language of the parent is the requested
language or part of its fallback chain, the related records are
overlaid with the requested language and its fallback chain. A parent
found by the uid of a translation in a language outside the requested
language and its fallback chain still passes its own language on to
the related records.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 79

  1. Alexander Schnitzler uploaded patch set 1 10/18/26, 06:35

  2. core-ci voted on patch set 1 V -1 10/18/26, 06:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111503

  3. Alexander Schnitzler uploaded patch set 2 V -1 10/18/26, 07:04

  4. core-ci voted on patch set 2 V +1 10/18/26, 07:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111505

  5. Oliver Klee voted on patch set 2 V +1 10/18/26, 09:24

  6. Oliver Klee voted on patch set 2 CR +1 10/18/26, 10:48

  7. Simon Schaufelberger voted on patch set 2 CR +1 V +1 11/06/26, 09:20

  8. Benni Mack voted on patch set 2 CR +2 V +2 11/09/26, 14:21

  9. Benni Mack merged patch set 3 11/09/26, 14:22