Issue Bug Closed

#76054Extbase ignores parent record's enableFields when using ContentFallback

Sengchheang Chhun 05/05/16, 07:08 updated 09/02/26, 14:02

Description

Environment
1. T3 7.6.6
2. Language setting as below

config {
    ## Language Settings
    linkVars = L(1-2)
    sys_language_uid = 0
    sys_language_overlay = 1
    language = de
    locale_all = de_CH.UTF-8
    alternate_html_xhtml_language = de
    htmlTag_langKey = de
    sys_language_softMergeIfNotBlank = tt_content:image, tt_content:caption
}

## Condition to change language settings for English
[globalVar = GP:L = 1]
    config {
        sys_language_uid = 1
        sys_language_mode = content_fallback; 0
        language = en
        locale_all = en_US.UTF-8
        alternate_html_xhtml_language = en
        htmlTag_langKey = en
    }
[end]

## Condition to change language settings for French
[globalVar = GP:L = 2]
    config {
        sys_language_uid = 2
        sys_language_mode = content_fallback; 1,0
        language = fr
        locale_all = fr_FR.UTF-8
        alternate_html_xhtml_language = fr
        htmlTag_langKey = fr
    }
[end]

3. There is small Extbase extension that contains product table that can be localised to another languages (above)

4. In backend, I create a new product record and then translate to EN and FR

*Issue*
When I hide (hidden=1) parent product record, the translated product records are still returned by repository (findAll)

*Assumption*
I understand that records which have language in EN or FR can be displayed as well when it is real orphan or independently created.
But this case is a bug and not that feature because the parent is still alive (only flagged as hidden) and the translated records keep storing the parentUid in its l10_parent as well.

*If my assumption is agreed,, the fix*
in typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php
in function “doLanguageAndWorkspaceOverlay“
in block

$overlaidRows = array();
        foreach ($rows as $row) {
            // If current row is a translation select its parent
            if (isset($tableName) && isset($GLOBALS['TCA'][$tableName])
                && isset($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])
                && isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'])
                && !isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerTable'])
            ) {
                if (isset($row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']])
                    && $row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']] > 0
                ) {
                    $row = $this->databaseHandle->exec_SELECTgetSingleRow(
                        $tableName . '.*',
                        $tableName,
                        $tableName . '.uid=' . (int)$row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']] .

                        /* BEFORE PATCHING */
                        //' AND ' . $tableName . '.' . $GLOBALS['TCA'][$tableName]['ctrl']['languageField'] . '=0'

                        /* AFTER PATCHING */
                        ' AND ' . $tableName . '.' . $GLOBALS['TCA'][$tableName]['ctrl']['languageField'] . '=0' . $pageRepository->enableFields($tableName)                    );

                }
            }
            $pageRepository->versionOL($tableName, $row, true);
            if ($tableName == 'pages') {
                $row = $pageRepository->getPageOverlay($row, $querySettings->getLanguageUid());
            } elseif (isset($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])
                && $GLOBALS['TCA'][$tableName]['ctrl']['languageField'] !== ''
                && !isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerTable'])
            ) {
                if (in_array($row[$GLOBALS['TCA'][$tableName]['ctrl']['languageField']], array(-1, 0))) {
                    $overlayMode = $querySettings->getLanguageMode() === 'strict' ? 'hideNonTranslated' : '';
                    $row = $pageRepository->getRecordOverlay($tableName, $row, $querySettings->getLanguageUid(), $overlayMode);
                }
            }
            if ($row !== null && is_array($row)) {
                $overlaidRows[] = $row;
            }
        }

Also good to have a look at file web/typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php
at function “getSysLanguageStatement” and when $mode is not ‘strict’

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 6

  1. Benni Mack commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2025-08-15T12:14:19+00:00" > 08/15/25, 12:14 </span>

    Hey,

    since TYPO3 v13.4.15, this should now works properly, as the enableFields are properly evaluated in parent records default language when using Content Fallback. Can you recheck?

  2. Benni Mack commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2026-09-02T14:02:24+00:00" > 09/02/26, 14:02 </span>

    good news. this is fixed!