Module: check_mk
Branch: master
Commit: 7c87e4fa5cb2b47cdfd93484dcc3d5464025eb38
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7c87e4fa5cb2b4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Aug 8 11:56:45 2014 +0200
#1154 FIX Availability: Fixed unwanted redirect to edit annotation page after editing
availability options
When editing an availability timeline, a user could add an annotation to a period, and
after that edit the
availability options. Now the user was redirected back to the annotation edit page, which
was a bug. This
has been fixed now.
---
.werks/1154 | 11 +++++++++++
ChangeLog | 1 +
web/plugins/views/availability.py | 8 +++++---
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/.werks/1154 b/.werks/1154
new file mode 100644
index 0000000..56cd872
--- /dev/null
+++ b/.werks/1154
@@ -0,0 +1,11 @@
+Title: Availability: Fixed unwanted redirect to edit annotation page after editing
availability options
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i6
+Date: 1407491710
+Class: fix
+
+When editing an availability timeline, a user could add an annotation to a period, and
after that edit the
+availability options. Now the user was redirected back to the annotation edit page, which
was a bug. This
+has been fixed now.
diff --git a/ChangeLog b/ChangeLog
index ba04921..18505e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,7 @@
* 1066 Implemented Dashboard Designer...
* 1067 FIX: Fixed login problem in LDAP connector when no user filter specified...
* 1094 FIX: sidebar snaping 'Tree of folders': fixed exception
+ * 1154 FIX: Availability: Fixed unwanted redirect to edit annotation page after
editing availability options...
WATO:
* 1064 FIX: Fixed rare issue with WATO communication in distributed setups (different
OS versions)...
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index ec12741..acdafa9 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -94,11 +94,11 @@ def render_availability(view, datasource, filterheaders,
display_options,
return
# We need the availability options now, but cannot display the
- # form code for that yet.
+ # form code for that yet. Ignore the HTML code.
html.plug()
avoptions = render_availability_options()
range, range_title = avoptions["range"]
- avoptions_html = html.drain()
+ html.drain()
html.unplug()
timeline = not not html.var("timeline")
@@ -154,7 +154,9 @@ def render_availability(view, datasource, filterheaders,
display_options,
html.end_context_buttons()
if not do_csv:
- html.write(avoptions_html)
+ # Render the avoptions again to get the HTML code, because the HTML vars have
changed
+ # above (anno_ and editanno_ has been removed, which must not be part of the
form
+ avoptions = render_availability_options()
if not html.has_user_errors():
if timeline and tl_aggr: