From 4668f81a8242e6c00bb68ff8d85b05ab1bcdec8d Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 19 Sep 2019 18:12:46 +0100 Subject: [IsleOfWight] limit filter category on national around page Only display non triage categories on this because getting the category expansion to work if we use the triage categories isn't in place and may not be. This is because when we get the list of reports using /around/ajax there's no way to know which body it is for so we don't know how to expand a triage category to the list of 'child' categories. So, just display the non triage ones for now. --- perllib/FixMyStreet/App/Controller/Around.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'perllib/FixMyStreet/App/Controller') diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index cebc4ed85..ebb3d4839 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -234,11 +234,12 @@ sub check_and_stash_category : Private { my @list_of_names = map { $_->name } values %bodies; my $csv = Text::CSV->new(); $csv->combine(@list_of_names); + $c->stash->{bodies} = \@bodies; $c->{stash}->{list_of_names_as_string} = $csv->string; my $where = { body_id => [ keys %bodies ], }; - my $cobrand_where = $c->cobrand->call_hook('munge_category_where', $where ); + my $cobrand_where = $c->cobrand->call_hook('munge_around_category_where', $where ); if ( $cobrand_where ) { $where = $cobrand_where; } @@ -257,7 +258,7 @@ sub check_and_stash_category : Private { my $categories = [ $c->get_param_list('filter_category', 1) ]; my %valid_categories = map { $_ => 1 } grep { $_ && $categories_mapped{$_} } @$categories; $c->stash->{filter_category} = \%valid_categories; - $c->cobrand->call_hook('munge_filter_category'); + $c->cobrand->call_hook('munge_around_filter_category_list'); } sub map_features : Private { @@ -318,7 +319,7 @@ sub ajax : Path('/ajax') { my %valid_categories = map { $_ => 1 } $c->get_param_list('filter_category', 1); $c->stash->{filter_category} = \%valid_categories; - $c->cobrand->call_hook('munge_filter_category'); + $c->cobrand->call_hook('munge_around_filter_category_list'); $c->forward('map_features', [ { bbox => $c->stash->{bbox} } ]); $c->forward('/reports/ajax', [ 'around/on_map_list_items.html' ]); -- cgit v1.2.3