501
return $params;
501
return $params;
505
my ($self, $args) = @_;
507
# For security purposes, and because lots of other checks depend on it,
508
# we set the product first before anything else.
509
my $product_change = 0;
510
if ($args->{product}) {
511
my $changed = $self->set_product($args->{product},
512
{ component => $args->{component},
513
version => $args->{version},
514
target_milestone => $args->{target_milestone},
515
change_confirmed => $args->{confirm_product_change},
516
other_bugs => $args->{other_bugs},
518
# that will be used later to check strict isolation
519
$product_change = $changed;
523
$self->remove_group($_) foreach @{$args->{remove_group}};
524
$self->add_group($_) foreach @{$args->{add_group}};
526
# this is temporary until all related code is moved from
527
# process_bug.cgi to set_all
528
return $product_change;
504
sub update {
531
sub update {
505
my $self = shift;
532
my $self = shift;
244
# For security purposes, and because lots of other checks depend on it,
244
my $product_change;
245
# we set the product first before anything else.
245
foreach my $bug (@bug_objects) {
246
my $product_change; # Used only for strict_isolation checks, right now.
246
my $args;
247
if (should_set('product')) {
247
if (should_set('product')) {
248
foreach my $b (@bug_objects) {
248
$args->{product} = scalar $cgi->param('product');
249
my $changed = $b->set_product(scalar $cgi->param('product'),
249
$args->{component} = scalar $cgi->param('component');
250
{ component => scalar $cgi->param('component'),
250
$args->{version} = scalar $cgi->param('version');
251
version => scalar $cgi->param('version'),
251
$args->{target_milestone} = scalar $cgi->param('target_milestone');
252
target_milestone => scalar $cgi->param('target_milestone'),
252
$args->{confirm_product_change} = scalar $cgi->param('confirm_product_change');
253
change_confirmed => scalar $cgi->param('confirm_product_change'),
253
$args->{other_bugs} = \@bug_objects;
254
other_bugs => \@bug_objects,
256
$product_change ||= $changed;
259
256
foreach my $group (@{$bug->product_obj->groups_valid}) {
260
# strict_isolation checks mean that we should set the groups
261
# immediately after changing the product.
262
foreach my $b (@bug_objects) {
263
foreach my $group (@{$b->product_obj->groups_valid}) {
264
my $gid = $group->id;
257
my $gid = $group->id;
265
if (should_set("bit-$gid", 1)) {
258
if (should_set("bit-$gid", 1)) {
266
# Check ! first to avoid having to check defined below.
259
# Check ! first to avoid having to check defined below.
267
if (!$cgi->param("bit-$gid")) {
260
if (!$cgi->param("bit-$gid")) {
268
$b->remove_group($gid);
261
push (@{$args->{remove_group}}, $gid);
270
# "== 1" is important because mass-change uses -1 to mean
263
# "== 1" is important because mass-change uses -1 to mean
271
# "don't change this restriction"
264
# "don't change this restriction"
272
elsif ($cgi->param("bit-$gid") == 1) {
265
elsif ($cgi->param("bit-$gid") == 1) {
273
$b->add_group($gid);
266
push (@{$args->{add_group}}, $gid);
271
# this will be deleted later when code moves to $bug->set_all
272
my $changed = $bug->set_all($args);
273
$product_change ||= $changed;
279
if ($cgi->param('id') && (defined $cgi->param('dependson')
276
if ($cgi->param('id') && (defined $cgi->param('dependson')