aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/New.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-06-17 15:01:35 +0100
committerMatthew Somerville <matthew@mysociety.org>2019-06-17 15:01:35 +0100
commit38c61346ca940f837b49fba3bc0548dd21b7ee39 (patch)
treeb605969bcc42abc34f71cd2f5d93a6d4fd0e7151 /perllib/FixMyStreet/App/Controller/Report/New.pm
parent4fb17bc32eda72ad8649b0218a37f4e9b50b5085 (diff)
parentc6b480d08c7aa9f8a08467e2631f7daa30b3be7e (diff)
Merge branch 'issues/2475-multiple-parents-for-categories'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 6a6040865..7c7ebd202 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -741,11 +741,13 @@ sub setup_categories_and_bodies : Private {
$c->stash->{missing_details_bodies} = \@missing_details_bodies;
$c->stash->{missing_details_body_names} = \@missing_details_body_names;
- if ( $c->cobrand->call_hook('enable_category_groups') ) {
+ if ( $c->cobrand->enable_category_groups ) {
my %category_groups = ();
for my $category (@category_options) {
- my $group = $category->{group} // $category->get_extra_metadata('group') // '';
- push @{$category_groups{$group}}, $category;
+ my $group = $category->{group} // $category->get_extra_metadata('group') // [''];
+ # this could be an array ref or a string
+ my @groups = ref $group eq 'ARRAY' ? @$group : ($group);
+ push( @{$category_groups{$_}}, $category ) for @groups;
}
my @category_groups = ();