[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)
committerXavier Perseguers <xavier@typo3.org>
Tue, 6 Mar 2012 08:50:44 +0000 (09:50 +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: Ic532c4582091043a5e24f228d21e05ac983c54e1
Fixes: #32467
Branches: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/9076
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
t3lib/class.t3lib_tcemain.php

index c63fa12..83f97f6 100644 (file)
@@ -5387,9 +5387,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;
+                                       }
                                }
                        }
                }