[BUGFIX] Adjust side-effects for TcaSelectItems test cases 31/55831/6
authorOliver Hader <oliver@typo3.org>
Tue, 20 Feb 2018 16:13:19 +0000 (17:13 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 20 Feb 2018 17:25:10 +0000 (18:25 +0100)
Resolves: #83980
Related: #83975
Releases: master
Change-Id: I2e8a9f3a5682644ef1dd1f3746be961a93ccafca
Reviewed-on: https://review.typo3.org/55831
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Imaging/IconRegistry.php

index 57c5f1a..6e20e44 100644 (file)
@@ -745,20 +745,18 @@ class IconRegistry implements SingletonInterface
     {
         $resultArray = [];
 
-        $tcaTables = array_keys($GLOBALS['TCA']);
+        $tcaTables = array_keys($GLOBALS['TCA'] ?? []);
         // check every table in the TCA, if an icon is needed
         foreach ($tcaTables as $tableName) {
             // This method is only needed for TCA tables where typeicon_classes are not configured
-            if (is_array($GLOBALS['TCA'][$tableName])) {
-                $tcaCtrl = $GLOBALS['TCA'][$tableName]['ctrl'];
-                $iconIdentifier = 'tcarecords-' . $tableName . '-default';
-                if (isset($this->icons[$iconIdentifier])) {
-                    continue;
-                }
-                if (isset($tcaCtrl['iconfile'])) {
-                    $resultArray[$iconIdentifier] = $tcaCtrl['iconfile'];
-                }
+            $iconIdentifier = 'tcarecords-' . $tableName . '-default';
+            if (
+                isset($this->icons[$iconIdentifier])
+                || !isset($GLOBALS['TCA'][$tableName]['ctrl']['iconfile'])
+            ) {
+                continue;
             }
+            $resultArray[$iconIdentifier] = $GLOBALS['TCA'][$tableName]['ctrl']['iconfile'];
         }
 
         foreach ($resultArray as $iconIdentifier => $iconFilePath) {