Skip to content

Child content not rendered in translated containers with "Strict Mode" language handling #626

@lilu82

Description

@lilu82

When using TYPO3's "Strict Mode" for language configuration (fallbacks: strict), child content elements inside a translated container element are not rendered in the frontend. The backend preview appears correct.

The issue seems to be caused by a condition in the Classes/Domain/Factory/FrontendContainerFactory.php that incorrectly checks the language overlay type.

Environment:
TYPO3 Version: 12.4.36
b13/container Version: 3.1.10

The following condition seems to be the cause:

if ($languageAspect->getOverlayType() === LanguageAspect::OVERLAYS_OFF && $record['l18n_parent'] > 0) {
    // This part of the WHERE clause is not added, causing children to be omitted.
    $conf['where'] .= ' OR tx_container_parent=' . $record['l18n_parent'];
}

When debugging the values in a frontend request for a translated page, the results are:

  • $languageAspect->getOverlayType() returns the string 'includeFloating'.
  • LanguageAspect::OVERLAYS_OFF is the string 'off'.

Because 'includeFloating' is not equal to 'off', the condition is false, and the part of the SQL query needed to fetch the child elements of the original language container is never added.

Workaround:
As a temporary fix, removing the $languageAspect->getOverlayType() === LanguageAspect::OVERLAYS_OFF part of the if statement resolves the issue and renders the content correctly:

// Temporary Fix
if ($record['l18n_parent'] > 0) {
    $conf['where'] .= ' OR tx_container_parent=' . $record['l18n_parent'];
}

This seems to indicate that the check for the overlay type is either incorrect for "Strict Mode" or no longer necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions