Bug #80104
closed
Wrong value in l18n_parent during localization
Added by Frank Rakow over 7 years ago.
Updated about 7 years ago.
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.
- Status changed from New to Needs Feedback
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.
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.
- Status changed from Needs Feedback to New
- Status changed from New to Rejected
- Priority changed from -- undefined -- to Should have
Also available in: Atom
PDF