Wrong l10n_state after copying a record
- Configure tt_content field "assets" with behaviour "allowLanguageSynchronization"
- Create a page with translation
- Create a content element with a media file ("assets") and translate it
- Change the translation behaviour from "Value of default language" to "Custom value" and add a different file
- Create a copy of the element
The copied translation has no image because the l10n_state value of "assets" was set from "custom" to "source" (see attachment).
The wrong state was set in DataMapItem: https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/core/Classes/DataHandling/Localization/DataMapItem.php#L443
Updated by Michael Rainer 4 months ago
- TYPO3 Version changed from 9 to 10
It's also reproducable in v10 (connected mode, copied records).
I think the main bug happens in the getType function:
On copied records, the l10n_overlay records first get a translationSource value of '0'.
And afterwards the getType function of DataMapItem decides for the copied l10n_overlay records, that they are
in a "TYPE_GRAND_CHILD" relation.
And therefore, the overlay states of the copied overlay records are updated to state "source", instead of keeping the state "custom".
For me the problem seems to be, that the "Overlay States behaviour" is mainly planned in terms of translation handling ( connected and free mode) and is therefore missing the copied behaviour.