mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
CMSMenu sort order (fixes #1716)
Regression caused by b645703eb9a46bb41d626eb0bb80ae7d3cdad378
This commit is contained in:
parent
ba7dfcfd54
commit
7d600f57d5
@ -154,7 +154,7 @@ class CMSMenu extends Object implements IteratorAggregate, i18nEntityProvider
|
|||||||
$menuPriority = array();
|
$menuPriority = array();
|
||||||
$menuTitle = array();
|
$menuTitle = array();
|
||||||
foreach($menuItems as $key => $menuItem) {
|
foreach($menuItems as $key => $menuItem) {
|
||||||
$menuPriority[$key] = $menuItem->priority;
|
$menuPriority[$key] = is_numeric($menuItem->priority) ? $menuItem->priority : 0;
|
||||||
$menuTitle[$key] = $menuItem->title;
|
$menuTitle[$key] = $menuItem->title;
|
||||||
}
|
}
|
||||||
array_multisort($menuPriority, SORT_DESC, $menuTitle, SORT_ASC, $menuItems);
|
array_multisort($menuPriority, SORT_DESC, $menuTitle, SORT_ASC, $menuItems);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user