summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-06-25 23:16:27 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-06-25 23:16:27 +0200
commit0d39e7b417190ad672219768eab41d627cc68bb9 (patch)
tree6cf83f87c52613161665338d942cc08904b0cb8c /process_bug.cgi
parented5c3b391a381d363e1b9070554d11c2b4881e3f (diff)
downloadbugzilla-0d39e7b417190ad672219768eab41d627cc68bb9.tar.gz
bugzilla-0d39e7b417190ad672219768eab41d627cc68bb9.tar.xz
Bug 573173: Make Bugzilla::Bug's add_group and remove_group take group
names instead of ids r=dkl, a=mkanat
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi25
1 files changed, 4 insertions, 21 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index 7759d03dc..f6da2af61 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -337,27 +337,10 @@ foreach my $field (grep(/^defined_isprivate/, $cgi->param())) {
}
$set_all_fields{comment_is_private} = \%is_private;
-my %groups = ( add => [], remove => [] );
-my %checked_bit; # Used to avoid adding groups twice (defined_ + actual bit-)
-foreach my $param_name (grep(/bit-\d+$/, $cgi->param())) {
- $param_name =~ /bit-(\d+)$/;
- my $gid = $1;
- next if $checked_bit{$gid};
- my $bit_param = "bit-$gid";
- if (should_set($bit_param, 1)) {
- # Check ! first to avoid having to check defined below.
- if (!$cgi->param($bit_param)) {
- push(@{ $groups{remove} }, $gid);
- }
- # "== 1" is important because mass-change uses -1 to mean
- # "don't change this restriction"
- elsif ($cgi->param($bit_param) == 1) {
- push(@{ $groups{add} }, $gid);
- }
- }
- $checked_bit{$gid} = 1;
-}
-$set_all_fields{groups} = \%groups;
+my @check_groups = $cgi->param('defined_groups');
+my @set_groups = $cgi->param('groups');
+my ($removed_groups) = diff_arrays(\@check_groups, \@set_groups);
+$set_all_fields{groups} = { add => \@set_groups, remove => $removed_groups };
my @custom_fields = Bugzilla->active_custom_fields;
foreach my $field (@custom_fields) {