Issue Bug Closed

#87948useDefaultLanguageRecord = 1 uses the translated record UID

Oliver Eglseder 03/19/19, 09:33 updated 04/01/20, 21:14

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.

Reviews 2