Review main Abandoned

89068[BUGFIX] Do not change a records' language via clipboard

Benni Mack CR 0 V -1 Easy +25 −2 updated 09/30/26, 15:16

Commit message

When using drag+drop or the clipboard via copy/cut
and paste, JavaScript tries to send the right values
to SimpleDataHandlerController. This is possible
by using cmdmap's commands "move" or "copy" and additionally
sending values such as the colPos - or - the language.

When dealing with language=-1 (ALL Languages), the JavaScript
tries to send the language with it, but at the same time
tries to restrict dragging + dropping between multiple languages
via the GUI.

When using the AJAX endpoint SimpleDataHandlerController
then (as soon via the network tab in the browser), the
language of the record "before" is also sent along
(that's the so-called "update" array within copy/move commands
in DataHandler). The SimpleDataHandler endpoint either
addresses a command, which is correctly done by
the Drag+Drop nowadays (done by Oliver Bartsch via #87148
in v10 bugfixing), for the cut/copy/paste action,
the clipboard placeholder is used, where we don't know which
language the record was placed before.

This resulted in "funny" situations with records of type
"sys_language_uid=-1" which were automatically merged to a
language=0 record, or vice versa, looking at the previous
record. This should not be allowed, and thus, the language
parameter is re-set (= ensured to be kept) from the clipboard
logic in PHP, so it is not possible to create an ugly state
via the AJAX endpoint anymore (also in other places like
List module).

It is done by using TcaSchema within SimpleDataHandlerController
which evaluates if the language field (sys_language_uid)
is planned to be updated, and thus, re-set.

Review

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

Issues 3

Files 1

Review log 913

  1. Benni Mack uploaded patch set 1 04/11/25, 16:19

  2. core-ci voted on patch set 1 V +1 04/11/25, 16:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77560

  3. Andreas Nedbal voted on patch set 1 CR +1 V +1 04/12/25, 11:24

  4. Stefan Bürk commented on patch set 1 CR -1 04/13/25, 12:42

    This does not solve the issue completly, following case does not work: * Create new page (default language) * Create element (ex. header only) with language = -1 (all) * Create element (ex. header only) in default language = 0 * Click the icon of the first element (-1) -> copy * Click paste button on the position below the second element (language = 0) The pasted element gets language = 0. Pasting the element directly below the original element insert it with language = -1. Inserting it directly above the original element inserts it with language = -1. I have done this multiple time, all scenarios. I also ensured to remove the item from the clipboard first and also reopen the page completly which does not make and difference. I could reproduce the aforementioned not working scenario over and over again.
  5. Benni Mack uploaded patch set 2 CR +1 V +1 04/13/25, 15:46

  6. core-ci voted on patch set 2 V -1 04/13/25, 15:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77674

  7. Benni Mack uploaded patch set 3 V -1 04/13/25, 16:08

  8. core-ci voted on patch set 3 V +1 04/13/25, 16:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77675

  9. Oli Bartsch voted on patch set 3 CR +1 04/14/25, 12:23

  10. Stefan Bürk commented on patch set 3 CR -1 04/14/25, 15:41

    Reply Unresolved

    The above described works now, however I found something else which should be at least discussed. Current behaviour without this change: * Copy a default language content element (language = 0 OR language -1) and pasting it in localized page (for example language = 1) the records is added at the position the paste button has been klicked and the language is updated to the page language = 1) * With this change, click on a position paste button of a foreign language page does not give any feedback, adds the copy after the original content element keeping the language (-1/0). * Same the other way round. Copy a element of page language = and pasting it at a position of default language adds the content element now below the orignal element keeping the language and not at the "expected" position with adopted language. I would postulate that this change, albeit fixing the issue within the same language it destroys the cross language copy&paste behaviour, which I would say is a legit thing editors may do, special in instances with free mode pages. Fixing this is not that easy, I would say. At least we should declare which scenarious are valid and if copy&paste between languages is not wanted that should be reflected (dedicated change) that the user does not have the ability to paste it (or modal telling about the cross language paste and why it is declined). From my side, this now revealed a bigger issue to be discussed and due to the change of behavior I would say that we should abstain for now from this bugfix until this has been thought and decided. What do you think ?

    Unresolved

    See discussion thread ... using -1 for not until it has been discussed.
  11. Benni Mack updated the commit message in patch set 4 CR +1 V +1 04/22/26, 06:55

  12. core-ci voted on patch set 4 V -1 04/22/26, 11:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100830

  13. Benni Mack abandoned the change 09/30/26, 15:16

    not needed anymore