aboutsummaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2008-06-29 00:01:44 +0000
committerlpsolit%gmail.com <>2008-06-29 00:01:44 +0000
commit75e92404700746d6fb0a05e6ee098fe88efc7530 (patch)
treeeb19b796bd0e2242dd6c0cd43e19bef40b8d5967 /process_bug.cgi
parentd97a8e06d0430028f411e15b603b34b717934535 (diff)
downloadbugs-75e92404700746d6fb0a05e6ee098fe88efc7530.tar
bugs-75e92404700746d6fb0a05e6ee098fe88efc7530.tar.gz
bugs-75e92404700746d6fb0a05e6ee098fe88efc7530.tar.bz2
bugs-75e92404700746d6fb0a05e6ee098fe88efc7530.tar.xz
bugs-75e92404700746d6fb0a05e6ee098fe88efc7530.zip
Bug 428440: Move code to set new product and related groups from process_bug.cgi to new function $bug->set_all - Patch by Noura Elhawary <nelhawar@redhat.com> r=LpSolit r=mkanat a=mkanat
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi39
1 files changed, 18 insertions, 21 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index cf24c96c9..bb680fab2 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -241,39 +241,36 @@ foreach my $bug (@bug_objects) {
}
}
-# For security purposes, and because lots of other checks depend on it,
-# we set the product first before anything else.
-my $product_change; # Used only for strict_isolation checks, right now.
-if (should_set('product')) {
- foreach my $b (@bug_objects) {
- my $changed = $b->set_product(scalar $cgi->param('product'),
- { component => scalar $cgi->param('component'),
- version => scalar $cgi->param('version'),
- target_milestone => scalar $cgi->param('target_milestone'),
- change_confirmed => scalar $cgi->param('confirm_product_change'),
- other_bugs => \@bug_objects,
- });
- $product_change ||= $changed;
+my $product_change;
+foreach my $bug (@bug_objects) {
+ my $args;
+ if (should_set('product')) {
+ $args->{product} = scalar $cgi->param('product');
+ $args->{component} = scalar $cgi->param('component');
+ $args->{version} = scalar $cgi->param('version');
+ $args->{target_milestone} = scalar $cgi->param('target_milestone');
+ $args->{confirm_product_change} = scalar $cgi->param('confirm_product_change');
+ $args->{other_bugs} = \@bug_objects;
}
-}
-
-# strict_isolation checks mean that we should set the groups
-# immediately after changing the product.
-foreach my $b (@bug_objects) {
- foreach my $group (@{$b->product_obj->groups_valid}) {
+
+ foreach my $group (@{$bug->product_obj->groups_valid}) {
my $gid = $group->id;
if (should_set("bit-$gid", 1)) {
# Check ! first to avoid having to check defined below.
if (!$cgi->param("bit-$gid")) {
- $b->remove_group($gid);
+ push (@{$args->{remove_group}}, $gid);
}
# "== 1" is important because mass-change uses -1 to mean
# "don't change this restriction"
elsif ($cgi->param("bit-$gid") == 1) {
- $b->add_group($gid);
+ push (@{$args->{add_group}}, $gid);
}
}
}
+
+ # this will be deleted later when code moves to $bug->set_all
+ my $changed = $bug->set_all($args);
+ $product_change ||= $changed;
}
if ($cgi->param('id') && (defined $cgi->param('dependson')