[checkmk-commits] Check_MK Git: check_mk: #1978 FIX Fixed linking to other views using " joined columns"

Lars Michelsen lm at mathias-kettner.de
Thu Feb 5 16:13:18 CET 2015


Module: check_mk
Branch: master
Commit: dc911b2ef640d8744a673cf12abf246b3d9e8b18
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dc911b2ef640d8744a673cf12abf246b3d9e8b18

Author: Lars Michelsen <lm at mathias-kettner.de>
Date:   Thu Feb  5 16:13:12 2015 +0100

#1978 FIX Fixed linking to other views using "joined columns"

Creating views with a joined columns which links to another view
resulted in an exception when displaying the view.

---

 .werks/1978         |   11 +++++++++++
 ChangeLog           |    1 +
 web/htdocs/views.py |   14 ++++++++------
 3 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/.werks/1978 b/.werks/1978
new file mode 100644
index 0000000..d0844e4
--- /dev/null
+++ b/.werks/1978
@@ -0,0 +1,11 @@
+Title: Fixed linking to other views using "joined columns"
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1423149130
+
+Creating views with a joined columns which links to another view
+resulted in an exception when displaying the view.
diff --git a/ChangeLog b/ChangeLog
index 26cbd65..2b75bcf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -182,6 +182,7 @@
     * 1972 FIX: Prevent erasing of quicksearch field when sidebar is reloaded (e.g. during activate changes)...
     * 1221 FIX: veeam_client: Multisite perfometer is now more robust
     * 1989 FIX: Fix sorting of services in availability views
+    * 1978 FIX: Fixed linking to other views using "joined columns"...
 
     WATO:
     * 1760 Added search form to manual checks page
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 0d0d2bc..76c7eff 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -2017,11 +2017,9 @@ def paint(p, row, tdattrs=""):
         html.write("<td %s>%s</td>" % (tdattrs, content))
     return content != ""
 
-def paint_painter(painter, row, join_key=None):
-    if join_key != None:
-        row = row.get("JOIN", {}).get(join_key)
-        if not row:
-            return "", ""  # no join information available for that column
+def paint_painter(painter, row):
+    if not row:
+        return "", ""  # no join information available for that column
 
     if "args" in painter:
         return painter["paint"](row, *painter["args"])
@@ -2036,7 +2034,11 @@ def prepare_paint(p, row):
     linkview = p[1]
     tooltip = len(p) > 2 and p[2] or None
 
-    tdclass, content = paint_painter(painter, row, join_key=get_join_key(p))
+    join_key = get_join_key(p)
+    if join_key != None:
+        row = row.get("JOIN", {}).get(join_key)
+
+    tdclass, content = paint_painter(painter, row)
     if tdclass == "" and content == "":
         return tdclass, content
 



More information about the checkmk-commits mailing list