Review 14.3 Merged

94916[BUGFIX] Find translations with empty l10n_source

Stefan Bürk CR +2 V +2 Normal +122 −22 updated 08/01/26, 18:44

Commit message

LocalizationRepository::getRecordTranslation(),
getRecordTranslations() and the deprecated
BackendUtility::getRecordLocalization() match existing
translations by the translationSource field (l10n_source)
whenever the table defines one, and fall back to the
transOrigPointerField (l10n_parent) only for tables without a
translation source field.

A translation carrying a correct l10n_parent but an empty
l10n_source is therefore not found, although it is a valid
translation. Such records are created by TYPO3 itself: a
DataHandler datamap creating a translation by only setting the
language field and the transOrigPointerField does not populate
l10n_source, which is the usual way extensions, importers and
migrations create translations.

DataHandler::localize() uses this lookup to detect already
existing localizations. As the existing translation is invisible,
the guard does not trigger and a second translation of the same
record in the same language is created.

The lookups keep preferring l10n_source, but additionally match
records whose l10n_source is empty by their transOrigPointerField,
so no valid translation is lost.

BackendUtility::getRecordLocalization() is deprecated but still
used, therefore it is fixed here as well - in contrast to the main
branch, where it has already been removed.

Review

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

Issues 1

Files 5

Review log 45

  1. Stefan Bürk uploaded patch set 1 07/23/26, 23:51

  2. core-ci voted on patch set 1 V +1 07/24/26, 00:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105272

  3. Benni Mack voted on patch set 1 CR +1 V +1 08/01/26, 15:08

  4. Stefan Bürk voted on patch set 1 CR +2 V +2 08/01/26, 18:44

  5. Stefan Bürk merged patch set 2 08/01/26, 18:44