Skip to content
Snippets Groups Projects
Commit 6f4ab275 authored by Richard Haeser's avatar Richard Haeser Committed by Christian Kuhn
Browse files

[BUGFIX] Make empty $GLOBALS['TBE_MODULES_EXT'] traversable

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/55297


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarRichard Haeser <richard@maxserv.com>
Tested-by: default avatarRichard Haeser <richard@maxserv.com>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 26f68b8a
Branches
Tags
No related merge requests found
......@@ -191,23 +191,25 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface
*/
protected function createMenuEntriesForTbeModulesExt()
{
foreach ($GLOBALS['TBE_MODULES_EXT'] as $mainModule => $tbeModuleExt) {
list($main) = explode('_', $mainModule);
$mainEntry = $this->findByModuleName($main);
if ($mainEntry === false) {
continue;
}
if (isset($GLOBALS['TBE_MODULES_EXT'])) {
foreach ((array)$GLOBALS['TBE_MODULES_EXT'] as $mainModule => $tbeModuleExt) {
list($main) = explode('_', $mainModule);
$mainEntry = $this->findByModuleName($main);
if ($mainEntry === false) {
continue;
}
$subEntries = $mainEntry->getChildren();
if (empty($subEntries)) {
continue;
}
$matchingSubEntry = $this->findByModuleName($mainModule);
if ($matchingSubEntry !== false) {
if (isset($tbeModuleExt['MOD_MENU']) && isset($tbeModuleExt['MOD_MENU']['function'])) {
foreach ($tbeModuleExt['MOD_MENU']['function'] as $subModule) {
$entry = $this->createEntryFromRawData($subModule);
$matchingSubEntry->addChild($entry);
$subEntries = $mainEntry->getChildren();
if (empty($subEntries)) {
continue;
}
$matchingSubEntry = $this->findByModuleName($mainModule);
if ($matchingSubEntry !== false) {
if (isset($tbeModuleExt['MOD_MENU']) && isset($tbeModuleExt['MOD_MENU']['function'])) {
foreach ($tbeModuleExt['MOD_MENU']['function'] as $subModule) {
$entry = $this->createEntryFromRawData($subModule);
$matchingSubEntry->addChild($entry);
}
}
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment