#59901Move records in list module kills sys_language_uid
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:
- tt_content:1, sys_language_uid:1
- tt_content:2, sys_language_uid:0
- 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
Related issues 6
- Bug #14873CE jumps from right to normal when moved in list mode
- Bug #16845Incorrect values of colPos, sys_language_uid and sorting after moving records in web > list
- Bug #25216Repositioning of translated CE in the list module replaces language ID
- Bug #39054Copied Content Elements incorrectly inherit language
- Bug #39798Language and colpos changes on re-ordering of Content Elements
- Bug #72988losing Localization when moving elements (Typo 7.6.2)