aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm3
-rw-r--r--perllib/FixMyStreet/App/Controller/My.pm3
2 files changed, 6 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;
diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm
index 9d57c5e1d..52a3a8cef 100644
--- a/perllib/FixMyStreet/App/Controller/My.pm
+++ b/perllib/FixMyStreet/App/Controller/My.pm
@@ -197,6 +197,9 @@ sub setup_page_data : Private {
distinct => 1,
order_by => [ "$table.category" ],
} )->all;
+ # Ensure only uniquely named categories are shown
+ my %seen;
+ @categories = grep { !$seen{$_->category_display}++ } @categories;
$c->stash->{filter_categories} = \@categories;
if ($c->cobrand->enable_category_groups) {