Review main Merged

92881[TASK] Extract localizeRecord() from DataHandler::copyRecord()

Benni Mack CR +2 V +2 Hard +251 −139 updated 02/20/26, 10:23

Commit message

copyRecord() served dual duty for both copying and localizing records,
with conditional logic driven by $language, $excludeFields, and
$ignoreLocalization parameters. This separation introduces a dedicated
localizeRecord() method for the localization path, called from
localize() for non-page records.

localizeRecord() omits copy-specific behaviors that don't apply to
localization: "copy-after" fields, "prepend label at copy", and
recursive l10n overlay copying.

copyRecord() is simplified by removing the now-unused $excludeFields
and $language parameters, reading the record's own language from the
row instead. Type hints are added to all parameters.

The newly created localizePage() and localizeRecord() sub methods
show that the underlying code has diverged already: localizing pages
never used the "copyRecord" code before, (just a new DataHandler
instance with a datamap) so it never cared about copying / localizing
references properly.

This should be investigated further. If this assumption is correct,
this means that $nonFields is currently not considered
when localizing pages, just when copying pages.

Two drive-by fixes were already made: page translations now have
the DataHandler->autoVersionIdMap filled and
DataHandler->errorLog merged.

Review

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

Issues 1

Files 3

Review log 1118

  1. Benni Mack uploaded patch set 1 02/18/26, 13:39

  2. core-ci voted on patch set 1 V -1 02/18/26, 14:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96143

  3. Benni Mack rebased onto patch set 2 V -1 02/18/26, 16:22

  4. core-ci voted on patch set 2 V +1 02/18/26, 17:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96172

  5. Benni Mack uploaded patch set 3 V +1 02/18/26, 21:01

  6. core-ci voted on patch set 3 V -1 02/18/26, 21:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96192

  7. Benni Mack uploaded patch set 4 V -1 02/18/26, 21:23

  8. core-ci voted on patch set 4 V -1 02/18/26, 21:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96193

  9. Benni Mack rebased onto patch set 5 V -1 02/18/26, 21:55

  10. core-ci voted on patch set 5 V -1 02/18/26, 22:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96196

  11. Benni Mack commented on patch set 6 V -1 02/19/26, 00:10

    Published edit on patch set 5.
  12. core-ci voted on patch set 6 V +1 02/19/26, 00:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96202

  13. Benni Mack updated the commit message in patch set 7 V +1 02/19/26, 08:34

  14. core-ci voted on patch set 7 V +1 02/19/26, 08:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96218

  15. Stefan Bürk voted on patch set 7 CR +1 V +1 02/19/26, 10:44

  16. Torben Hansen voted on patch set 7 CR +1 V +1 02/20/26, 10:14

  17. Benni Mack voted on patch set 7 CR +2 V +2 02/20/26, 10:23

  18. Benni Mack merged patch set 8 02/20/26, 10:23