From 0ec361034928e702045692a7d97aa98e542ce1f9 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 17 Sep 2015 13:40:40 +0200 Subject: [PATCH] Web: Properly load shared menu items refs #5600 --- library/Icinga/Application/Web.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Application/Web.php b/library/Icinga/Application/Web.php index 765170b84..538afb029 100644 --- a/library/Icinga/Application/Web.php +++ b/library/Icinga/Application/Web.php @@ -182,7 +182,6 @@ class Web extends EmbeddedWeb $config = Config::app('navigation')->getConfigObject(); $config->setKeyColumn('name'); - $navigation = new Navigation(); if ($type === 'dashboard-pane') { $panes = array(); foreach ($config->select()->where('type', 'dashlet') as $dashletName => $dashletConfig) { @@ -192,6 +191,7 @@ class Web extends EmbeddedWeb } } + $navigation = new Navigation(); foreach ($panes as $paneName => $dashlets) { $navigation->addItem( $paneName, @@ -202,11 +202,14 @@ class Web extends EmbeddedWeb ); } } else { + $items = array(); foreach ($config->select()->where('type', $type) as $name => $typeConfig) { if ($this->hasAccessToSharedNavigationItem($typeConfig)) { - $navigation->addItem($name, $typeConfig->toArray()); + $items[$name] = $typeConfig; } } + + $navigation = Navigation::fromConfig($items); } return $navigation;