Bug #80104
closedWrong value in l18n_parent during localization
0%
Description
scenario:
language A (default)
language B
language C
We have an element which were localized in 'copy' mode form A to B.
Localizing it from language B to C with the 'translate' mode, so the l18n_parent is 0
I think that isn't correct. The l18n_parent must become the uid of the localized B element, because this is now the original.
BackendUtility::getRecordLocalization failed and you will never get the localized element when l18n_parent is 0.
Updated by Georg Ringer over 7 years ago
- Status changed from New to Needs Feedback
is this patch https://review.typo3.org/#/c/51406/ already applied? if no, can you test with a latest master?
Updated by Frank Rakow over 7 years ago
yes, patch was applied. It was tested with master 0f21eaad.
I think the problem is in typo3/sysext/core/Classes/DataHandling/DataHandler.php:4738
// If the translated record is a default language record, set it's uid as localization parent of the new record. // If translating from any other language, no override is needed; we just can copy the localization parent of // the original record (which is pointing to the correspondent default language record) to the new record. // In copy / free mode the TransOrigPointer field is always set to 0, as no connection to the localization parent is wanted in that case. 4738: if (($this->useTransOrigPointerField && (int)$row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] === 0) || $table === 'pages') { $overrideValues[$GLOBALS['TCA'][$Ttable]['ctrl']['transOrigPointerField']] = $uid; } elseif (!$this->useTransOrigPointerField) { $overrideValues[$GLOBALS['TCA'][$Ttable]['ctrl']['transOrigPointerField']] = 0; }
$row[$GLOBALS['TCA'][$table]['ctrl']['languageField']]
is in my test 1
is $row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] === 0
necessary at all?
May be this is correct if (($this->useTransOrigPointerField && (int)$row[$GLOBALS['TCA'][$Ttable]['ctrl']['transOrigPointerField']] === 0)
I have tested it and the result was correct.
Updated by Frank Rakow over 7 years ago
Another error is that the 'Translate' button is displayed, and then you can translate the element from language A to C.
The language C is set to the language B in the translation mode.
So it should not be possible to translate from language A to C.
Updated by Riccardo De Contardi over 7 years ago
- Status changed from Needs Feedback to New
Updated by Tymoteusz Motylewski about 7 years ago
- Status changed from New to Rejected
- Priority changed from -- undefined -- to Should have
Hi
The behaviour is correct, please see my answer on stack overflow:
https://stackoverflow.com/questions/28996899/typo3-tt-content-structure-t3-origuid-vs-l18n-parent/40524638#40524638
l10n_parent / l18n_parent¶
The field configured in TCA as transOrigPointerField (usually l10n_parent or l18n_parent) is used for localization. It always contains an id of the record in the default language (even if the record was translated from a record in non-default language), see https://docs.typo3.org/typo3cms/TCAReference/singlehtml/#transorigpointerfield
l10n_source (since TYPO3 8.6)¶
Since TYPO3 8.6 a new database field l10n_source for tt_content table has been introduced together with a new TCA ctrl configuration translationSource. The translationSource field contains an uid of the record used as a translation source, no matter whether the record was translated in the free or connected mode.
see more in the documentation on l10n_source field here https://docs.typo3.org/typo3cms/extensions/core/Changelog/8.6/Feature-78169-IntroduceTranslationSourceFieldForTt_content.html
Please let me know if this doesn't solve the issue for you.