diff --git a/setup/compiler.class.inc.php b/setup/compiler.class.inc.php index 79b056a76..bce8da8f1 100644 --- a/setup/compiler.class.inc.php +++ b/setup/compiler.class.inc.php @@ -122,13 +122,14 @@ class MFCompiler EOF; // Preliminary: determine parent menus not defined within the current module $aMenusToLoad = array(); - + $aParentMenus = array(); foreach($aMenusByModule[$sModuleName] as $sMenuId) { $oMenuNode = $aMenuNodes[$sMenuId]; if ($sParent = $oMenuNode->GetChildText('parent', null)) { $aMenusToLoad[] = $sParent; + $aParentMenus[] = $sParent; } // Note: the order matters: the parents must be defined BEFORE $aMenusToLoad[] = $sMenuId; @@ -137,6 +138,14 @@ EOF; foreach($aMenusToLoad as $sMenuId) { $oMenuNode = $aMenuNodes[$sMenuId]; + if ($oMenuNode->getAttribute("xsi:type") == 'MenuGroup') + { + if (!in_array($oMenuNode->getAttribute("id"), $aParentMenus)) + { + // Discard empty menu groups + continue; + } + } try { $sCompiledCode .= $this->CompileMenu($oMenuNode, $sRelativeDir, $oP);