Module: check_mk
Branch: master
Commit: d6768d38ad924f4088dbaecd89369ceff6e16f3f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d6768d38ad924f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Apr 14 10:23:46 2016 +0200
3398 FIX Fix exception in Matrix layout if it contains certain complex columns
---
.werks/3398 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/views.py | 10 +++++++++-
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/.werks/3398 b/.werks/3398
new file mode 100644
index 0000000..7c37f1b
--- /dev/null
+++ b/.werks/3398
@@ -0,0 +1,10 @@
+Title: Fix exception in Matrix layout if it contains certain complex columns
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1460622196
+
+
diff --git a/ChangeLog b/ChangeLog
index 298247a..ef251c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -202,6 +202,7 @@
* 3375 FIX: Fixed exception when adding a bookmark while having a list not named
my_bookmarks
* 3118 FIX: Availability view now takes daylight saving time into account
* 3395 FIX: Fix performance issue when many BI aggregations are active...
+ * 3398 FIX: Fix exception in Matrix layout if it contains certain complex columns
WATO:
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index e9df56f..783c5f9 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -2421,7 +2421,15 @@ def group_value(row, group_painters):
for c in get_painter_columns(p[0]):
if c in row:
group.append(row[c])
- return tuple(group)
+ return create_dict_key(group)
+
+def create_dict_key(value):
+ if type(value) in (list, tuple):
+ return tuple(map(create_dict_key, value))
+ elif type(value) == dict:
+ return tuple([ (k, create_dict_key(v)) for (k, v) in sorted(value.items()) ])
+ else:
+ return value
def get_painter_option(name):
opt = multisite_painter_options[name]