[icinga-checkins] icinga.org: icingaweb2/feature/add-to-dashboard-4537: Widget\FilterEditor: fix root element stripping

git at icinga.org git at icinga.org
Wed Nov 19 11:48:11 CET 2014


Module: icingaweb2
Branch: feature/add-to-dashboard-4537
Commit: eb823c40452eab0e61e47280db8a8a084c606336
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=eb823c40452eab0e61e47280db8a8a084c606336

Author: Thomas Gelf <thomas at gelf.net>
Date:   Wed Nov 19 09:53:25 2014 +0100

Widget\FilterEditor: fix root element stripping

---

 library/Icinga/Web/Widget/FilterEditor.php |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/library/Icinga/Web/Widget/FilterEditor.php b/library/Icinga/Web/Widget/FilterEditor.php
index cc35491..2abc897 100644
--- a/library/Icinga/Web/Widget/FilterEditor.php
+++ b/library/Icinga/Web/Widget/FilterEditor.php
@@ -218,7 +218,12 @@ class FilterEditor extends AbstractWidget
 
         if ($strip) {
             $redirect = $this->url();
-            $filter->replaceById($strip, $filter->getById($strip . '-1'));
+            $subId = $strip . '-1';
+            if ($filter->getId() === $strip) {
+                $filter = $filter->getById($strip . '-1');
+            } else {
+                $filter->replaceById($strip, $filter->getById($strip . '-1'));
+            }
             $redirect->setQueryString($filter->toQueryString())->getParams()->add('modifyFilter');
             $this->redirectNow($redirect->addParams($preserve));
         }



More information about the icinga-checkins mailing list