Bug #87948

useDefaultLanguageRecord = 1 uses the translated record UID

Added by Oliver Eglseder 3 months ago. Updated 2 months ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2019-03-19
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

The documentation (https://docs.typo3.org/typo3cms/TSconfigReference/PageTsconfig/TceMain.html#preview) says:

The useDefaultLanguageRecord defaults to 1 and ensures that translated records will use the uid of the default record for the preview link. You may disable this, if your extension can deal with the uid of translated records.

So if useDefaultLanguageRecord = 1 -> $recordId should be the UID of the record with sys_language_uid = 0.
If you have a look to the code (shortened):

        if ($languageField && !empty($recordArray[$languageField])) {
            $l18nPointer = $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] ?? '';
            if ($l18nPointer && !empty($recordArray[$l18nPointer])
                && isset($previewConfiguration['useDefaultLanguageRecord'])
                && !$previewConfiguration['useDefaultLanguageRecord']
            ) {
                // use parent record
                $recordId = $recordArray[$l18nPointer];
            }
        }

There is a !$previewConfiguration['useDefaultLanguageRecord'] which turns a useDefaultLanguageRecord = 1 into false and the recordId will never be set to the original language record.

This is a logical problem.

History

#1 Updated by Gerrit Code Review 3 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60297

#2 Updated by Gerrit Code Review 3 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60297

#3 Updated by Benni Mack 2 months ago

  • Category changed from Miscellaneous to Localization

Also available in: Atom PDF