Module: check_mk
Branch: master
Commit: 3b122d4f1de5750c031cffe93c107507c445e5db
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3b122d4f1de575…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Nov 8 14:31:35 2013 +0100
FIX WATO forms: incorrect handling of checkbox state
---
.werks/33 | 8 ++++++++
ChangeLog | 1 +
web/htdocs/htmllib.py | 6 +++---
web/htdocs/wato.py | 6 +++++-
4 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/.werks/33 b/.werks/33
new file mode 100644
index 0000000..f4304e5
--- /dev/null
+++ b/.werks/33
@@ -0,0 +1,8 @@
+Title: WATO forms: incorrect handling of checkbox state
+Level: 1
+Component: wato
+Version: 1.2.3i7
+Date: 1383917396
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 700b194..9e9b7a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,7 @@
WATO:
* 0053 New rule for configuring the display_name of a service...
* 0048 FIX: Fixed locking issue on host diagnose page
+ * 0033 FIX: WATO forms: incorrect handling of checkbox state
Notifications:
* 0032 FIX: mail notification plugin: replace windows forbidden characters in mail
images
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index d9f209c..2912d54 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -583,8 +583,8 @@ class html:
form_name = self.form_name
return self.has_var("filled_in") and (
- self.form_name == None or \
- self.form_name in self.list_var("filled_in"))
+ form_name == None or \
+ form_name in self.list_var("filled_in"))
# Get value of checkbox. Return True, False or None. None means
@@ -594,7 +594,7 @@ class html:
def get_checkbox(self, varname, form_name = None):
if self.has_var(varname):
return not not self.var(varname)
- elif not self.form_filled_in():
+ elif not self.form_filled_in(form_name):
return None
else:
# Form filled in but variable missing -> Checkbox not checked
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 3728d33..83c113b 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2296,7 +2296,11 @@ def mode_diag_host(phase):
reload_hosts(g_folder)
call_hook_hosts_changed(g_folder)
- html.http_redirect(make_link([("mode", "edithost"),
("host", hostname), ("folder", g_folder[".path"])]))
+ html.del_all_vars()
+ html.set_var("host", hostname)
+ html.set_var("folder", g_folder[".path"])
+
+ return "edithost"
return
html.write('<div class="diag_host">')