[BUGFIX] Make empty $GLOBALS['TBE_MODULES_EXT'] traversable 74/55274/7
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:07:16 +0000 (23:07 +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/55274
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Reviewed-by: Richard Haeser <richard@maxserv.com>
Tested-by: Richard Haeser <richard@maxserv.com>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php

index 2899392..f81ba31 100644 (file)
@@ -188,7 +188,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) {