浏览代码

#745 Default menu is not computed correctly (depends on the customizations made to the menu -> order of declaration)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2882 a333f486-631f-4898-b8df-5754b55c2be0
romainq 11 年之前
父节点
当前提交
6496274eef
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      application/menunode.class.inc.php

+ 3 - 1
application/menunode.class.inc.php

@@ -300,7 +300,9 @@ class ApplicationMenu
 			// Make sure the root menu is sorted on 'rank'
 			usort(self::$aRootMenus, array('ApplicationMenu', 'CompareOnRank'));
 			$oFirstGroup = self::GetMenuNode(self::$aRootMenus[0]['index']);
-			$oMenuNode = self::GetMenuNode(self::$aMenusIndex[$oFirstGroup->GetIndex()]['children'][0]['index']);
+			$aChildren = self::$aMenusIndex[$oFirstGroup->GetIndex()]['children'];
+			usort($aChildren, array('ApplicationMenu', 'CompareOnRank'));
+			$oMenuNode = self::GetMenuNode($aChildren[0]['index']);
 			$sMenuId = $oMenuNode->GetMenuId();
 		}
 		return $sMenuId;