Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Ready for review

93752[BUGFIX] Skip translations when pasting into another language

Eric Harrer CR -1 V 0 Hard +487 −5 updated 11/12/26, 21:44

Commit message

When a default language record is copied and pasted into another
language, DataHandler copied the translations of the record as
well and set all copies to the target language afterwards. The
copied translation ended up with a transOrigPointerField pointing
to a record of the very same language.

The paste target language is now handed to copyRecord() as
override value: The copy is created in the target language right
away, and translations of the record and of its child records are
not copied along. The latter matters in workspaces, where child
records are copied using copyRecord() as well.

Access to the target language is checked before relations are
copied, so a denied paste no longer leaves a copy in the default
language behind.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 6
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/52/93752/6 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/52/93752/6 && git cherry-pick FETCH_HEAD

Review

  • Code review CR -1 Needs a vote
    • Benni Mack -1
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Issues 1

Files 19

Review log 914

  1. Eric Harrer uploaded patch set 1 04/20/26, 13:00

  2. core-ci voted on patch set 1 V +1 04/20/26, 13:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100562

  3. Benni Mack updated the commit message in patch set 2 V +1 04/22/26, 07:19

  4. Eric Harrer rebased onto patch set 3 04/23/26, 10:44

  5. core-ci voted on patch set 3 V +1 04/23/26, 11:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101026

  6. Eric Harrer uploaded patch set 4 V +1 08/28/26, 22:37

  7. core-ci voted on patch set 4 V +1 08/28/26, 22:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107333

  8. Benni Mack commented on patch set 4 CR -1 11/12/26, 21:16

    Unresolved

    The fix does what it should for plain records, and creating the copy directly in the target language is OK I think. Three things I found: 1) Regression with translated inline children in workspaces Scenario (IrreForeignField, workspace): localize tt_content:298 (with a hotel child) to language 1, then paste 298 with update[sys_language_uid]=2. In a workspace, copyRecord_processRelation() copies children via copyRecord(), which still calls copyL10nOverlayRecords() for each child. The patch only skips the overlays of the root record. Result: - main today: the copied child translation is attached to the copied parent translation. Wrong language, but self-contained. - with this patch: the parent translation is no longer copied, the child translation still is. It ends up with sys_language_uid=2, l18n_parent pointing to the copied child (same language) and parentid pointing to the *existing* translation of the source record. Same for the offer one level below. The reference index of the existing translation is dirty afterwards. So the same-language l18n_parent issue remains for children, and an unrelated existing record gets a foreign child. Live is fine, as children are copied with copyRecord_raw() there. The "do not copy overlays" decision needs to reach the child copies as well, see the @todo in process_cmdmap(). Please add an IRRE scenario for live and workspace covering this. 2) deniedCopyPasteToLanguageStopsBeforeCopyingInlineChildren is green without the fix The copy is rejected earlier with 'Attempt to copy record "tt_content:..." without read permissions', as the editor has no permissions on page 89. The new checkLanguageAccess() branch is not executed by any test. The editor needs page permissions (ideally via a group fixture instead of overriding groupData), and the test should assert the log entry. It is also not a hook test, so HookTest is not the best place for it. The WorkspacesDiscard variant passes without the fix as well.
  9. Benni Mack uploaded patch set 5 CR -1 V +1 11/12/26, 21:20

  10. Benni Mack voted on patch set 5 CR -1 11/12/26, 21:22

  11. Benni Mack uploaded patch set 6 CR -1 11/12/26, 21:23

  12. core-ci voted on patch set 5 V +1 11/12/26, 21:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114244

  13. core-ci voted on patch set 6 V +1 11/12/26, 21:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114245

  14. Benni Mack voted on patch set 6 CR -1 11/12/26, 21:44