Issue Bug Closed

#73670Page Module: View broken with localized (flux) content elements.

Sabrina Sauter 02/25/16, 12:36 updated 10/02/18, 11:18

Description

After upgrading to TYPO3 7.6.4 and on selecting the page module on pages with localized flux contents, following error is thrown:

Invalid argument supplied for foreach() in /typo3/sysext/backend/Classes/View/PageLayoutView.php line 1812

foreach ($this->contentElementCache[$lP][$colPos] as $record) {
    $key = array_search($record['t3_origuid'], $defLanguageCount);
    if ($key !== false) {
        unset($defLanguageCount[$key]);
    }
}

This is called e.g. in /typo3conf/ext/flux/Classes/View/PreviewView.php, newLanguageButton().

It seems not to check whether the incoming data is an array. Simply wrapping the above code snippet into this if-statement seems to fix it (don’t know about any side effects, localization seems to work fine):

if(is_array($this->contentElementCache[$lP][$colPos])) {
    …
}

Can you look into this? Thank you.

Reviews 2