Issue Bug Closed

#93881select.includeRecordsWithoutDefaultTranslation = 0 not possible

Christoph Lehmann 04/08/21, 10:29 updated 07/09/24, 12:45

Description

In \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::getLanguageRestriction()

if (isset($conf['includeRecordsWithoutDefaultTranslation']) || $conf['includeRecordsWithoutDefaultTranslation.']) {
    $includeRecordsWithoutDefaultTranslation = isset($conf['includeRecordsWithoutDefaultTranslation.']) ?
        $this->stdWrap($conf['includeRecordsWithoutDefaultTranslation'], $conf['includeRecordsWithoutDefaultTranslation.']) : $conf['includeRecordsWithoutDefaultTranslation'];
    $includeRecordsWithoutDefaultTranslation = trim($includeRecordsWithoutDefaultTranslation) !== '';
} else {
    // Option was not explicitly set, check what's in for the language overlay type.
    $includeRecordsWithoutDefaultTranslation = $languageAspect->getOverlayType() === $languageAspect::OVERLAYS_ON_WITH_FLOATING;
}

If i see it correct the line

$includeRecordsWithoutDefaultTranslation = trim($includeRecordsWithoutDefaultTranslation) !== '';

should be a type cast to bool or should further check if the value is 0

Reviews 2