Module: check_mk
Branch: master
Commit: fc066d9e86eec81c882c709b4f7a7cbea8efc156
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fc066d9e86eec8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 2 10:04:05 2014 +0100
#1579 FIX Views: Setting for hard coded single context filters can now be changed by URL
and filter
When a view has a hard coded value for a single context filter, the value could
not be changed by the user when watching a view, neither by URL nor filter form.
This has been changed now to make it possible to override the default value.
---
.werks/1579 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/visuals.py | 6 +++---
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/.werks/1579 b/.werks/1579
new file mode 100644
index 0000000..3ac34ce
--- /dev/null
+++ b/.werks/1579
@@ -0,0 +1,11 @@
+Title: Views: Setting for hard coded single context filters can now be changed by URL and
filter
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417510947
+Class: fix
+
+When a view has a hard coded value for a single context filter, the value could
+not be changed by the user when watching a view, neither by URL nor filter form.
+This has been changed now to make it possible to override the default value.
diff --git a/ChangeLog b/ChangeLog
index 5d7e4e5..b6f4c24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -91,6 +91,7 @@
* 1557 FIX: Fix sorting of hostnames that only differ in lower/uppercaseness
* 1577 FIX: Fixed editing of views using the "Downtime for host/service"
sorter or column...
* 1578 FIX: Folding states of containers with umlauts in titles are now persisted...
+ * 1579 FIX: Views: Setting for hard coded single context filters can now be changed
by URL and filter...
WATO:
* 1170 Added buttons to move rules to top/bottom of the list to ruleset edit dialog
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index f7115a7..5185dfc 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -903,10 +903,10 @@ def add_context_to_uri_vars(visual, only_infos=None,
only_count=False):
only_infos = infos.keys() # all datasources!
# Populate the HTML vars with missing context vars. The context vars set
- # in single context are enforced (can not be overwritten by URL). The normal
- # filter vars in "multiple" context are not enforced.
+ # in single context are not enforced (they can be overwritten by URL or by
+ # changing the filter form).
for key in get_single_info_keys(visual):
- if key in visual['context']:
+ if key in visual['context'] and not html.has_var(key):
html.set_var(key, visual['context'][key])
# Now apply the multiple context filters