Module: check_mk
Branch: master
Commit: afcc661063ec51e8ea7f282504dbdd33b94e251b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=afcc661063ec51…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Aug 28 15:38:55 2015 +0200
In previous versions Check_MK raised exceptions when a view is using sorters
or painters that do not exist anymore. This could easily happen for the painters
and sorters created dynamically for each tag group.
Check_MK is now silently skipping these sorters and painters to prevent the
exception and make use of such views possible again. You can then remove
those sorters / painters using the view editor.
Conflicts:
web/htdocs/views.py
---
.werks/2549 | 16 ++++++++++++++++
ChangeLog | 1 +
web/htdocs/views.py | 9 ++++++---
3 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/.werks/2549 b/.werks/2549
new file mode 100644
index 0000000..3387011
--- /dev/null
+++ b/.werks/2549
@@ -0,0 +1,16 @@
+Title: Silently ignore not existing painters and sorters in views
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1440768969
+
+In previous versions Check_MK raised exceptions when a view is using sorters
+or painters that do not exist anymore. This could easily happen for the painters
+and sorters created dynamically for each tag group.
+
+Check_MK is now silently skipping these sorters and painters to prevent the
+exception and make use of such views possible again. You can then remove
+those sorters / painters using the view editor.
diff --git a/ChangeLog b/ChangeLog
index f4c5847..b9c9ed3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -179,6 +179,7 @@
* 2510 FIX: Fixed sidebar frame scaling in chrome when using browser zoom
* 2544 FIX: Fixed links to availability timeline using the context buttons
* 2548 FIX: Fixed exceptions in different places in case of user errors...
+ * 2549 FIX: Silently ignore not existing painters and sorters in views...
WATO:
* 2365 Removed old deprecated notification global options for plain emails...
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 98802ed..a0a10bb 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1006,15 +1006,18 @@ def show_view(view, show_heading = False, show_buttons = True,
# Sorting - use view sorters and URL supplied sorters
if not only_count:
sorter_list = html.has_var('sort') and
parse_url_sorters(html.var('sort')) or view["sorters"]
- sorters = [ (multisite_sorters[s[0]],) + s[1:] for s in sorter_list ]
+ sorters = [ (multisite_sorters[s[0]],) + s[1:] for s in sorter_list
+ if s[0] in multisite_sorters ]
else:
sorters = []
# Prepare grouping information
- group_painters = [ (multisite_painters[e[0]],) + e[1:] for e in
view["group_painters"] ]
+ group_painters = [ (multisite_painters[e[0]],) + e[1:] for e in
view["group_painters"]
+ if e[0] in multisite_painters ]
# Prepare columns to paint
- painters = [ (multisite_painters[e[0]],) + e[1:] for e in view["painters"]
if e[0] in multisite_painters ]
+ painters = [ (multisite_painters[e[0]],) + e[1:] for e in view["painters"]
+ if e[0] in multisite_painters ]
# Now compute the list of all columns we need to query via Livestatus.
# Those are: (1) columns used by the sorters in use, (2) columns use by