[icinga-checkins] icinga.org: icingaweb2/master: Menu: Don' t render sub menus when a dot appears in the label

git at icinga.org git at icinga.org
Fri Nov 21 17:40:46 CET 2014


Module: icingaweb2
Branch: master
Commit: eed10159fdecfd33064d7bef0f799f2076f31e7e
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=eed10159fdecfd33064d7bef0f799f2076f31e7e

Author: Eric Lippmann <eric.lippmann at netways.de>
Date:   Fri Nov 21 17:39:18 2014 +0100

Menu: Don't render sub menus when a dot appears in the label

I guess this was intended to be a feature. Turns out to be a bug though :)

fixes #7772

---

 library/Icinga/Web/Menu.php |   17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/library/Icinga/Web/Menu.php b/library/Icinga/Web/Menu.php
index 9362bbb..dafe66a 100644
--- a/library/Icinga/Web/Menu.php
+++ b/library/Icinga/Web/Menu.php
@@ -437,21 +437,8 @@ class Menu implements RecursiveIterator
      */
     public function addSubMenu($id, ConfigObject $menuConfig = null)
     {
-        if (false === ($pos = strpos($id, '.'))) {
-            $subMenu = new static($id, $menuConfig, $this);
-            $this->subMenus[$id] = $subMenu;
-        } else {
-            list($parentId, $id) = explode('.', $id, 2);
-
-            if ($this->hasSubMenu($parentId)) {
-                $parent = $this->getSubMenu($parentId);
-            } else {
-                $parent = $this->addSubMenu($parentId);
-            }
-
-            $subMenu = $parent->addSubMenu($id, $menuConfig);
-        }
-
+        $subMenu = new static($id, $menuConfig, $this);
+        $this->subMenus[$id] = $subMenu;
         return $subMenu;
     }
 



More information about the icinga-checkins mailing list