Issue Bug Closed

#73872Invalid argument supplied for foreach in PageLayoutView

Dmitry Dulepov 03/02/16, 15:59 updated 03/03/16, 11:48

Description

Getting a warning:

PHP Warning
Core: Error handler (BE): PHP Warning: Invalid argument supplied for foreach() in /home/***/vendor/typo3/cms/typo3/sysext/backend/Classes/View/PageLayoutView.php line 1802

Code in question is:

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

It looks like it should be checked that it is an array before looping.

This is function newLanguageButton, when “Languages” is selected instead of “Columns” in the Page module.

Reviews 0

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