From 0a7d60d504466e883d13f7f7e8fbabec96ce87c5 Mon Sep 17 00:00:00 2001 From: Christian Zenker Date: Sat, 27 Apr 2013 14:59:56 +0200 Subject: [PATCH] [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 --- typo3/sysext/backend/Classes/View/PageLayoutView.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: -- 2.20.1