aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--t/app/controller/around.t3
-rw-r--r--templates/web/base/reports/_list-filters.html2
2 files changed, 4 insertions, 1 deletions
diff --git a/t/app/controller/around.t b/t/app/controller/around.t
index bd2bf2cee..cd992270f 100644
--- a/t/app/controller/around.t
+++ b/t/app/controller/around.t
@@ -261,6 +261,9 @@ subtest 'check category, status and extra filtering works on /around' => sub {
$mech->get_ok( '/around?filter_category=Pothole&bbox=' . $bbox );
$mech->content_contains('<option value="Pothole" selected>');
$mech->content_contains('<optgroup label="Environment">');
+
+ $mech->get_ok( '/around?filter_group=Environment&bbox=' . $bbox );
+ $mech->content_contains('<option value="Flytipping" selected>');
};
$json = $mech->get_ok_json( '/around?ajax=1&filter_category=Pothole&bbox=' . $bbox );
diff --git a/templates/web/base/reports/_list-filters.html b/templates/web/base/reports/_list-filters.html
index 3125f63b1..f5d1faa65 100644
--- a/templates/web/base/reports/_list-filters.html
+++ b/templates/web/base/reports/_list-filters.html
@@ -2,7 +2,7 @@
[% BLOCK category_options %]
[% FOR cat IN categories %]
- <option value="[% cat.category %]"[% ' selected' IF filter_category.${cat.category} OR ( filter_group AND ( cat.get_extra_metadata('group') == filter_group OR cat.category == filter_group ) ) %]>
+ <option value="[% cat.category %]"[% ' selected' IF filter_category.${cat.category} OR ( filter_group AND ( cat.get_extra_metadata('group').grep(filter_group).size OR cat.category == filter_group ) ) %]>
[% cat.category_display %]
[%~ IF cat.get_extra_metadata('help_text') %] ([% cat.get_extra_metadata('help_text') %])[% END ~%]
</option>