diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin/Bodies.pm | 9 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 8 |
2 files changed, 12 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm index 0e47d2238..2ff69b3b5 100644 --- a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm +++ b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm @@ -273,8 +273,13 @@ sub update_contacts : Private { if ( $c->get_param('reputation_threshold') ) { $contact->set_extra_metadata( reputation_threshold => int($c->get_param('reputation_threshold')) ); } - if ( my $group = $c->get_param('group') ) { - $contact->set_extra_metadata( group => $group ); + if ( my @group = $c->get_param_list('group') ) { + @group = grep { $_ } @group; + if (scalar @group == 0) { + $contact->unset_extra_metadata( 'group' ); + } else { + $contact->set_extra_metadata( group => \@group ); + } } else { $contact->unset_extra_metadata( 'group' ); } 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 = (); |