Module: check_mk
Branch: master
Commit: 6c84a34d54ab2e9600a6d144306d4ca43a87d911
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6c84a34d54ab2e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Oct 31 16:50:09 2014 +0100
#1482 FIX Fix exception when editing a visual of type single host group
Context editor was broken, because there were two filters with the
same HTML variable name <tt>hostgroup</tt>. This has been fixed
by renaming the name of the host group selection filter to
<tt>host_group</tt>.
---
.werks/1482 | 12 ++++++++++++
ChangeLog | 1 +
web/htdocs/visuals.py | 10 +++++++---
web/plugins/visuals/filters.py | 4 ++--
4 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/.werks/1482 b/.werks/1482
new file mode 100644
index 0000000..2797d3a
--- /dev/null
+++ b/.werks/1482
@@ -0,0 +1,12 @@
+Title: Fix exception when editing a visual of type single host group
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i7
+Date: 1414770553
+Class: fix
+
+Context editor was broken, because there were two filters with the
+same HTML variable name <tt>hostgroup</tt>. This has been fixed
+by renaming the name of the host group selection filter to
<tt>host_group</tt>.
+
diff --git a/ChangeLog b/ChangeLog
index ec8160c..69fd65b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
* 1164 FIX: Fixed links from servicegroup overviews to single servicegroups
* 1166 FIX: Also prevting stylesheet update issues during version updates (just like
for JS files)
* 1481 FIX: Fix broken layout of Host-, Service- and Contactgroup filters
+ * 1482 FIX: Fix exception when editing a visual of type single host group...
WATO:
* 1165 FIX: Fixed exception in service discovery of logwatch event console forwarding
checks...
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index 4dd059f..ab59a2f 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -848,9 +848,13 @@ class Filter:
# Is used to populate a value, for example loaded from persistance, into
# the HTML context where it can be used by e.g. the display() method.
def set_value(self, value):
- val = {}
- for varname in self.htmlvars:
- html.set_var(varname, value.get(varname))
+ try:
+ val = {}
+ for varname in self.htmlvars:
+ html.set_var(varname, value.get(varname))
+ except:
+ html.debug("%r, %s" % (self, self.name))
+ raise
def get_filter(name):
return multisite_filters[name]
diff --git a/web/plugins/visuals/filters.py b/web/plugins/visuals/filters.py
index 573fc49..7fe6150 100644
--- a/web/plugins/visuals/filters.py
+++ b/web/plugins/visuals/filters.py
@@ -184,13 +184,13 @@ class FilterGroupCombo(Filter):
def __init__(self, what, title, enforce):
self.enforce = enforce
self.prefix = not self.enforce and "opt" or ""
- htmlvars = [ self.prefix + what + "group" ]
+ htmlvars = [ self.prefix + what + "_group" ]
if not enforce:
htmlvars.append("neg_" + htmlvars[0])
Filter.__init__(self, self.prefix + what + "group", # name, e.g.
"hostgroup"
title, # title, e.g.
"Hostgroup"
what.split("_")[0], # info, e.g.
"host"
- htmlvars, # htmlvars, e.g.
"hostgroup"
+ htmlvars, # htmlvars, e.g.
"host_group"
[ what + "group_name" ]) # rows needed to
fetch for link information
self.what = what