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
* @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: