Review main Merged

96436[BUGFIX] Keep translated relations on import

Benjamin Kott CR +2 V +2 Expert +1173 −2 updated 10/10/26, 10:37

Commit message

Importing translated records whose inline or file field uses
l10n_mode=exclude, for example the images of a distribution's
translated content, failed with a TypeError in DataHandler.

EXT:impexp restores the relations of such records in one data-map, and
three things went wrong on the way:

  * The children still pointed to their parent by the uid it had in
    the export, which belongs to an unrelated record after the import.
    EXT:impexp now resets that pointer when it imports a child, and
    restores it from the field of the parent afterwards, as before.
  * DataMapProcessor took the "<table>_<uid>" form of the relations
    literally. It now resolves it, as it does for translation pointers
    already.
  * DataMapProcessor looked up the translations of the children in the
    database only, where their translation pointers are not stored
    yet. It now considers the pointers submitted in the same data-map.

So far, it deleted imported translated children, attached children to
the wrong translation or queued new children without a pid.

Independently of that, a new record whose pid cannot be resolved, as it
has none, points to a NEW id that was never stored or is to be placed
behind a record that does not exist, is now skipped with a logged error
instead of failing with a TypeError or PHP warnings. Such a record
cannot be stored anyway. This happens for example when an import could
not write the parent page.

Review

  • Code review CR +2 Done
    • Benjamin Kott +2
    • Wolfgang Klinger +1
    • Benni Mack +1
  • Verified V +2 Done
    • Benjamin Kott +2
    • Wolfgang Klinger +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 3

Files 11

Review log 67

  1. Benjamin Kott uploaded patch set 1 10/06/26, 23:24

  2. Wolfgang Klinger commented on patch set 1 CR +1 V +1 10/07/26, 08:24

    Verified with real data on top of the included tests. One question: why not 13.4? The TypeError exists there too and the introduction package still targets ^13.4.
  3. core-ci voted on patch set 1 V +1 10/07/26, 09:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110282

  4. Benni Mack voted on patch set 1 CR +1 V +1 10/09/26, 20:08

  5. Benni Mack commented on patch set 1 10/10/26, 06:26

    Reply

    Although I completely understand the reasoning behind it, I'm very very reluctant to backport DataHandler changes nowadays to the "critical bugfixes only" branch. Various changes now made it to 14.3 only in this area, so I can only stress all of you enough to upgrade to v14
  6. Benjamin Kott voted on patch set 1 CR +2 V +2 10/10/26, 09:52

  7. Benjamin Kott merged patch set 2 10/10/26, 10:37