Review main Abandoned

97291[BUGFIX] Keep target language when localizing without language field

Oli Bartsch CR 0 V 0 Hard +303 −1 updated 11/03/26, 08:43

Commit message

An editor who may use a language but has no access to the exclude
field "tt_content:sys_language_uid" can run the translation wizard.
The new record was silently stored in the default language: a plain
duplicate in copy mode, or a default language record pointing to a
localization parent in translate mode. Copying a record with
translations had the same effect on the copied translations.

localize() and copyRecord() compute the language field, the
localization parent and the translation source themselves. They then
store the record through a datamap of an internal DataHandler
instance, which dropped the language field like any submitted exclude
field the user may not edit.

These fields are now exempt from the exclude field check for exactly
the record localizeRecord(), localizePage() or copyRecord() creates.
Access to the target language (allowed_languages) is still checked.
Language fields submitted by the user are still dropped for such an
editor.

Since a copy now keeps its language, a copy into another language is
handled explicitly for such an editor. A paste that changes the
language, as the Layout module sends it when an element is pasted or
dragged into another language column, is refused and logged instead
of creating a record in the wrong language. A copy inserted after a
record of another language keeps its own language, also when
"copyAfterDuplFields" lists the language field. Moving is unchanged.

Review

  • Code review CR 0
  • Verified V 0
    • core-ci +1 CI

Issues 1

Files 15

Review log 58

  1. Oli Bartsch uploaded patch set 1 11/01/26, 22:08

  2. core-ci voted on patch set 1 V +1 11/01/26, 22:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113047

  3. Oli Bartsch uploaded patch set 2 V +1 11/01/26, 22:32

  4. core-ci voted on patch set 2 V +1 11/01/26, 22:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113050

  5. Oli Bartsch uploaded patch set 3 V +1 11/01/26, 23:18

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

  7. Daniel Windloff commented on patch set 3 11/03/26, 06:20

    Unresolved

    I prefer Georg's approach for main, as it does not add a new special condition and new state via a new DataHandler property for language fields: https://review.typo3.org/c/Packages/TYPO3.CMS/+/95929 Benni also has a patch regarding this area: https://review.typo3.org/c/Packages/TYPO3.CMS/+/97294
  8. Oli Bartsch abandoned the change 11/03/26, 08:43

    in favour of 97294