[+BUGFIX] Extbase (Configuration): Fix warning in AbstractConfigurationManager
authorSebastian Kurfürst <sebastian@typo3.org>
Thu, 13 Jan 2011 05:40:51 +0000 (05:40 +0000)
committerSebastian Kurfürst <sebastian@typo3.org>
Thu, 13 Jan 2011 05:40:51 +0000 (05:40 +0000)
If there are no non cacheable actions defined for a controller, the AbstractConfigurationManager throws a warning when overriding switchable controller actions: array_intersect(): Argument 1 is not an array.

This change fixes the issue.
Resolves: #11631

typo3/sysext/extbase/Classes/Configuration/AbstractConfigurationManager.php

index d880808..98b20b7 100644 (file)
@@ -190,6 +190,13 @@ abstract class Tx_Extbase_Configuration_AbstractConfigurationManager implements
                        }
                        $overriddenSwitchableControllerActions[$controllerName] = array('actions' => $actions);
                        $nonCacheableActions = $frameworkConfiguration['controllerConfiguration'][$controllerName]['nonCacheableActions'];
+
+                       if (!is_array($nonCacheableActions)) {
+                               // There are no non-cacheable actions, thus we can directly continue
+                               // with the next controller name.
+                               continue;
+                       }
+
                        $overriddenNonCacheableActions = array_intersect($nonCacheableActions, $actions);
                        if (!empty($overriddenNonCacheableActions)) {
                                $overriddenSwitchableControllerActions[$controllerName]['nonCacheableActions'] = $overriddenNonCacheableActions;