From: Christian Zenker Date: Sat, 27 Apr 2013 12:59:56 +0000 (+0200) Subject: [BUGFIX] Empty columns in Page Module view cause warnings X-Git-Tag: TYPO3_6-2-0alpha1~158 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/0a7d60d504466e883d13f7f7e8fbabec96ce87c5?ds=sidebyside [BUGFIX] Empty columns in Page Module view cause warnings The iteration over columns in the page module layout view expects arrays. Since it might happen, that there is no element for a particular column, variables need to be initialized with an empty array. Change-Id: I63b4b26a87f1520139c9d66d0c096a78d39e409c Fixes: #47529 Releases: 6.2, 6.1, 6.0, 4.7, 4.5 Reviewed-on: https://review.typo3.org/20229 Reviewed-by: Oliver Hader Tested-by: Oliver Hader --- diff --git a/typo3/sysext/backend/Classes/View/PageLayoutView.php b/typo3/sysext/backend/Classes/View/PageLayoutView.php index 95a2697d6308..d9a7d09e3bba 100644 --- a/typo3/sysext/backend/Classes/View/PageLayoutView.php +++ b/typo3/sysext/backend/Classes/View/PageLayoutView.php @@ -953,9 +953,9 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe * @return array Associative array for each column (colPos) */ protected function getContentRecordsPerColumn($table, $id, array $columns, $additionalWhereClause = '') { - $contentRecordsPerColumn = array(); - $columns = array_map('intval', $columns); + $contentRecordsPerColumn = array_fill_keys($columns, array()); + $queryParts = $this->makeQueryArray('tt_content', $id, 'AND colPos IN (' . implode(',', $columns) . ')' . $additionalWhereClause); $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts); // Traverse any selected elements and render their display code: