[BUGFIX] Make empty $GLOBALS['TBE_MODULES_EXT'] traversable 96/55296/2
authorRichard Haeser <richard@maxserv.com>
Fri, 5 Jan 2018 10:44:01 +0000 (11:44 +0100)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Sun, 7 Jan 2018 22:10:25 +0000 (23:10 +0100)
Prevent warnings and notices if $GLOBALS['TBE_MODULES_EXT'] is not
set, which can be the case if no extensions are installed.

Change-Id: I72f513329790ee3b71fd30054574b79f41a6dcf8
Resolves: #83479
Releases: master, 8.7, 7.6
Reviewed-on: https://review.typo3.org/55296
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php

index 7a5c805..bb17aa3 100644 (file)
@@ -190,7 +190,7 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface
      */
     protected function createMenuEntriesForTbeModulesExt()
     {
-        foreach ($GLOBALS['TBE_MODULES_EXT'] as $mainModule => $tbeModuleExt) {
+        foreach ($GLOBALS['TBE_MODULES_EXT'] ?? [] as $mainModule => $tbeModuleExt) {
             list($main) = explode('_', $mainModule);
             $mainEntry = $this->findByModuleName($main);
             if ($mainEntry === false) {