Bug #88974

Wrong l10n_state after copying a record

Added by Alexander Vogt over 2 years ago. Updated 4 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2019-08-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Prerequisites
  1. Configure tt_content field "assets" with behaviour "allowLanguageSynchronization"
Steps to reproduce:
  1. Create a page with translation
  2. Create a content element with a media file ("assets") and translate it
  3. Change the translation behaviour from "Value of default language" to "Custom value" and add a different file
  4. Create a copy of the element

Result:
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


Files

elementcopy.PNG (73.7 KB) elementcopy.PNG Alexander Vogt, 2019-08-19 09:50
assets-of-translation.PNG (15.4 KB) assets-of-translation.PNG Alexander Vogt, 2019-08-19 09:51
#1

Updated by Alexander Vogt over 1 year ago

Any news here? This issue still exists with 9.5.18

#2

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'.
(https://github.com/TYPO3/typo3/blob/9.5/typo3/sysext/core/Classes/DataHandling/DataHandler.php#L3757 )
And afterwards the getType function of DataMapItem decides for the copied l10n_overlay records, that they are
in a "TYPE_GRAND_CHILD" relation.
(https://github.com/TYPO3/typo3/blob/9.5/typo3/sysext/core/Classes/DataHandling/Localization/DataMapItem.php#L246 )
And therefore, the overlay states of the copied overlay records are updated to state "source", instead of keeping the state "custom".
(https://github.com/TYPO3/typo3/blob/9.5/typo3/sysext/core/Classes/DataHandling/Localization/DataMapItem.php#L443)

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.

Also available in: Atom PDF