diff options
author | Dave Arter <davea@mysociety.org> | 2020-08-25 17:04:01 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2020-08-28 12:33:13 +0100 |
commit | f784713cbebb8e9026544ab969a5a3404f736429 (patch) | |
tree | 1f6f94108e0821d036ff5d3ff4166c644c613ef1 /perllib/FixMyStreet/App/Controller/Around.pm | |
parent | 470c24e00b12ac82fa7d34534cb9c1bd6cda53ff (diff) |
Don’t display duplicate categories in filter on /around and /my
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Around.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 4c5c36106..7b98f01f8 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -254,6 +254,9 @@ sub check_and_stash_category : Private { distinct => 1 } )->all_sorted; + # Ensure only uniquely named categories are shown + my %seen; + @categories = grep { !$seen{$_->category_display}++ } @categories; $c->stash->{filter_categories} = \@categories; my %categories_mapped = map { $_->category => 1 } @categories; $c->forward('/report/stash_category_groups', [ \@categories ]) if $c->cobrand->enable_category_groups; |