[BUGFIX] Warnings in tcemain on iterating over unset columns
authorMario Rimann <typo3-coding@rimann.org>
Thu, 16 Feb 2012 21:30:18 +0000 (22:30 +0100)
committerGeorg Ringer <mail@ringerge.org>
Fri, 17 Feb 2012 07:52:24 +0000 (08:52 +0100)
Adds a check if the TCA for the table has a columns setting at all
before iterating over the columns of that table.

Change-Id: Id5f968d5c6b6df0df5285de1311c537089570bce
Fixes: #32467
Branches: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/9061
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
t3lib/class.t3lib_tcemain.php

index e7b6536..347f07a 100644 (file)
@@ -5366,9 +5366,16 @@ class t3lib_TCEmain {
                $list = array();
                foreach (array_keys($GLOBALS['TCA']) as $table) {
                        t3lib_div::loadTCA($table);
-                       foreach ($GLOBALS['TCA'][$table]['columns'] as $field => $config) {
-                               if ($config['exclude'] && !t3lib_div::inList($this->BE_USER->groupData['non_exclude_fields'], $table . ':' . $field)) {
-                                       $list[] = $table . '-' . $field;
+                       if (isset($GLOBALS['TCA'][$table]['columns'])) {
+                               foreach ($GLOBALS['TCA'][$table]['columns'] as $field => $config) {
+                                       if ($config['exclude']
+                                               && !t3lib_div::inList(
+                                                       $this->BE_USER->groupData['non_exclude_fields'],
+                                                       $table . ':' . $field
+                                               )
+                                       ) {
+                                               $list[] = $table . '-' . $field;
+                                       }
                                }
                        }
                }