Issue Bug Closed

#59901Move records in list module kills sys_language_uid

Stephan Schuler 06/26/14, 13:21 updated 04/21/20, 10:42

Description

Hey there.

I discovered a very nasty thing crashing lots of tt_contents silently.

I call it a “Must have” because it really messes everything up. When you drop a single new tt_content at the end of backend list view and push it all the way up to the very first list postion in backend list view, nearly every tt_content in between gets touched and looses its language.

Example situation:

  1. tt_content:1, sys_language_uid:1
  2. tt_content:2, sys_language_uid:0
  3. tt_content:3, sys_langugae_uid:1, l18n_parent:2

Open list module in “Localization View”, which allows to move tt_content:1 one step down or tt_content:2 one step up.

Example action:

Now click on tt_content:2 to move it above tt_content:1.

Result:
tt_content:2 gets repositioned, just as expected.
tt_content:1 gets updated by DataHandling::moveRecord() -> GridElements\DataHandler\ProcessCmdmap::execute_processCmdmap() -> DataHandler::copyRecord()

I don’t really get what this hook thingy is meant to do.
But in the end tt_content:1:sys_language_uid is updated from 1 to 0 because tt_content:2:sys_language_uid is 0.

Example action:

Revert to example situation, of course.
Now click on tt_content:1 to move it below tt_content:2.

Result:
tt_content:1 gets repositioned, just as expected.
tt_content:2 gets updated by the very same hook queue.

In the end, tt_content:2:sys_language_uid is updated from 0 to 1 because tt_content:1:sys_language_uid is 1.

Fix:

See patch attached.

I would suggest to drop “sys_language_uid” from “copyAfterDuplFields” when calling the hook manually. That shouldn’t do much of a difference because I cannot imagine any situation where the sys_language_uid should by updated.

Reviews 2