Module: check_mk
Branch: master
Commit: ba5ff43bfe445678144fc40c1efa506d621882fd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ba5ff43bfe4456…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 25 15:24:16 2016 +0100
4072 FIX Fixed multiple issues in BI availability when groups or names contain umlauts
---
.werks/4072 | 10 ++++++++++
ChangeLog | 3 ++-
web/htdocs/htmllib.py | 4 ++--
web/htdocs/visuals.py | 12 ++++++++++++
web/plugins/visuals/bi.py | 8 ++++----
web/plugins/visuals/infos.py | 4 ++--
6 files changed, 32 insertions(+), 9 deletions(-)
diff --git a/.werks/4072 b/.werks/4072
new file mode 100644
index 0000000..11c3236
--- /dev/null
+++ b/.werks/4072
@@ -0,0 +1,10 @@
+Title: Fixed multiple issues in BI availability when groups or names contain umlauts
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i3
+Date: 1480083735
+
+
diff --git a/ChangeLog b/ChangeLog
index 0df8445..a023526 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -23,7 +23,7 @@
* 3751 FIX: jolokia_metrics: Discovery no longer crashes in case of error querying
instance
* 4088 FIX: ntp: fixed incomplete data handling
* 4090 FIX: apc_rackpdu_power, apc_symmetra, apc_symmetra_input, apc_symmetra_output:
some fixes...
- * 4091 FIX: oracle_tablespace: Werk 3907 broke the detection of UNDO- and
TEMP-Tablespaces
+ * 4091 FIX: oracle_tablespaces: Werk 3907 broke the detection of UNDO- and
TEMP-Tablespaces
* 4069 FIX: cmciii.phase: Fixed broken check with some devices...
* 4092 FIX: if.include: fixed wrong calculated number of interfaces which are up in
case of interface groups
* 4093 FIX: oracle_tablespaces: Werk 3907 broke the space calculation...
@@ -37,6 +37,7 @@
* 3980 FIX: Fixed possible flickering GUI when using Chrome and zooming the page
* 3981 FIX: Views: Fixed context button displaying depending on usage
* 4071 FIX: Removed notes_url from "LOG *" logwatch services...
+ * 4072 FIX: Fixed multiple issues in BI availability when groups or names contain
umlauts
WATO:
* 3984 Permissions can now be filtered by providing a search term on the "edit
role" page...
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index a74d3ad..97e6c0b 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1661,10 +1661,10 @@ class html(DeprecationWrapper):
value = self.vars.get(var, "")
self.hidden_field(var, value)
else: # add *all* get variables, that are not set by any input!
- for var, value in self.vars.items():
+ for var in self.vars:
if var not in self.form_vars and \
(var[0] != "_" or add_action_vars): # and var !=
"filled_in":
- self.hidden_field(var, value)
+ self.hidden_field(var, self.get_unicode_input(var))
def hidden_field(self, *args, **kwargs):
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index 96f38f4..e903a6e 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -933,6 +933,18 @@ class Filter:
for varname in self.htmlvars:
html.set_var(varname, value.get(varname))
+
+
+# TODO: We should merge this with Filter() and make all vars unicode ...
+class FilterUnicodeFilter(Filter):
+ def value(self):
+ val = {}
+ for varname in self.htmlvars:
+ val[varname] = html.get_unicode_input(varname, '')
+ return val
+
+
+
def get_filter(name):
return multisite_filters[name]
diff --git a/web/plugins/visuals/bi.py b/web/plugins/visuals/bi.py
index e5fd8c5..9028710 100644
--- a/web/plugins/visuals/bi.py
+++ b/web/plugins/visuals/bi.py
@@ -26,10 +26,10 @@
import bi
-class BIGroupFilter(Filter):
+class BIGroupFilter(FilterUnicodeFilter):
def __init__(self):
self.column = "aggr_group"
- Filter.__init__(self, self.column, _("Aggregation group"),
"aggr", [self.column], [self.column])
+ FilterUnicodeFilter.__init__(self, self.column, _("Aggregation group"),
"aggr", [self.column], [self.column])
def variable_settings(self, row):
return [ (self.htmlvars[0], row[self.column]) ]
@@ -54,7 +54,7 @@ class BIGroupFilter(Filter):
declare_filter( 90, BIGroupFilter())
# how is either "regex" or "exact"
-class BITextFilter(Filter):
+class BITextFilter(FilterUnicodeFilter):
def __init__(self, what, how="regex", suffix=""):
self.how = how
self.column = "aggr_" + what
@@ -65,7 +65,7 @@ class BITextFilter(Filter):
label = _('Aggregation output')
if how == "exact":
label += _(" (exact match)")
- Filter.__init__(self, self.column + suffix,
+ FilterUnicodeFilter.__init__(self, self.column + suffix,
label, "aggr", [self.column + suffix], [self.column])
def variable_settings(self, row):
diff --git a/web/plugins/visuals/infos.py b/web/plugins/visuals/infos.py
index 3504805..6fea49b 100644
--- a/web/plugins/visuals/infos.py
+++ b/web/plugins/visuals/infos.py
@@ -116,7 +116,7 @@ infos['aggr'] = {
'title' : _('BI Aggregation'),
'title_plural': _('BI Aggregations'),
'single_spec' : [
- ('aggr_name', TextAscii(
+ ('aggr_name', TextUnicode(
title = _('Aggregation Name'),
)),
],
@@ -126,7 +126,7 @@ infos['aggr_group'] = {
'title' : _('BI Aggregation Group'),
'title_plural': _('BI Aggregation Groups'),
'single_spec' : [
- ('aggr_group', TextAscii(
+ ('aggr_group', TextUnicode(
title = _('Aggregation group'),
)),
],