diff options
author | Struan Donald <struan@exo.org.uk> | 2019-05-23 14:59:49 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-06-17 14:24:23 +0100 |
commit | c6b480d08c7aa9f8a08467e2631f7daa30b3be7e (patch) | |
tree | 32d08a0bc661b8959d13bbcdb17a5b3e482d8a27 /perllib/FixMyStreet | |
parent | 5ed63071d7813fdcbcb0f6f7d5bacdd28ce90a10 (diff) |
admin interface for adding multiple groups to a category
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin/Bodies.pm | 9 |
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' ); } |