diff --git a/src/collective/collectionfilter/baseviews.py b/src/collective/collectionfilter/baseviews.py index 7bfa64f5..5f89208f 100644 --- a/src/collective/collectionfilter/baseviews.py +++ b/src/collective/collectionfilter/baseviews.py @@ -99,7 +99,7 @@ def pat_options(self): "reloadURL": self.reload_url, "ajaxLoad": self.ajax_load, "contentSelector": self.content_selector, - "notifyOnly": self.notify_only + "notifyOnly": getattr(self, "notify_only", False) } ) diff --git a/src/collective/collectionfilter/filteritems.py b/src/collective/collectionfilter/filteritems.py index 3568b167..08eb91a6 100644 --- a/src/collective/collectionfilter/filteritems.py +++ b/src/collective/collectionfilter/filteritems.py @@ -159,7 +159,13 @@ def get_filter_items( # Get index in question and the current filter value of this index, if set. groupby_criteria = getUtility(IGroupByCriteria).groupby idx = groupby_criteria[group_by]["index"] - current_idx_value = safe_iterable(request_params.get(idx)) + + # Added: use index modifier, if available + # This fixes e.g. boolean indices which couldn’t show the current value as selected + idx_mod = groupby_criteria[group_by]["index_modifier"] + crit = request_params.get(idx) + crit = idx_mod(crit) if idx_mod else safe_decode(crit) + current_idx_value = safe_iterable(crit) # Additive filtering is about adding other filter values of the same index. extra_ignores = [] if narrow_down else [idx, idx + "_operator"]