Review 14.3 Merged

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

Benni Mack CR +2 V +2 Hard +259 −5 updated 11/09/26, 15:57

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
  • Verified V +2 Done
    • Benni Mack +2
    • core-ci +1 CI

Issues 1

Files 3

Review log 58

  1. Benni Mack commented on patch set 1 11/09/26, 14:21

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V -1 11/09/26, 14:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113705

  3. Benni Mack commented on patch set 2 V -1 11/09/26, 14:48

    Published edit on patch set 1.
  4. core-ci voted on patch set 2 V -1 11/09/26, 15:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113710

  5. Benni Mack commented on patch set 3 V -1 11/09/26, 15:26

    Published edit on patch set 2.
  6. core-ci voted on patch set 3 V +1 11/09/26, 15:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113721

  7. Benni Mack voted on patch set 3 CR +2 V +2 11/09/26, 15:57

  8. Benni Mack merged patch set 4 11/09/26, 15:57