aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Admin
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/Admin
parent4fb17bc32eda72ad8649b0218a37f4e9b50b5085 (diff)
parentc6b480d08c7aa9f8a08467e2631f7daa30b3be7e (diff)
Merge branch 'issues/2475-multiple-parents-for-categories'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin/Bodies.pm9
1 files changed, 7 insertions, 2 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' );
}