From dd80a6716d34b2be54553245b725087ae3ee9acc Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Mon, 24 May 2010 12:56:47 -0700 Subject: Bug 556407: Move the code for setting product and checking strict_isolation from process_bug.cgi into Bugzilla::Bug::set_all --- process_bug.cgi | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) (limited to 'process_bug.cgi') diff --git a/process_bug.cgi b/process_bug.cgi index d2ba976a8..3c67f15c9 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -239,22 +239,6 @@ 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; - } -} - # Component, target_milestone, and version are in here just in case # the 'product' field wasn't defined in the CGI. It doesn't hurt to set # them twice. @@ -264,7 +248,8 @@ my @set_fields = qw(op_sys rep_platform priority bug_severity deadline remaining_time estimated_time work_time set_default_assignee set_default_qa_contact keywords keywordaction - cclist_accessible reporter_accessible); + cclist_accessible reporter_accessible + product confirm_product_change); push(@set_fields, 'assigned_to') if !$cgi->param('set_default_assignee'); push(@set_fields, 'qa_contact') if !$cgi->param('set_default_qa_contact'); my %field_translation = ( @@ -275,9 +260,10 @@ my %field_translation = ( set_default_assignee => 'reset_assigned_to', set_default_qa_contact => 'reset_qa_contact', keywordaction => 'keywords_action', + confirm_product_change => 'product_change_confirmed', ); -my %set_all_fields; +my %set_all_fields = ( other_bugs => \@bug_objects ); foreach my $field_name (@set_fields) { if (should_set($field_name, 1)) { my $param_name = $field_translation{$field_name} || $field_name; @@ -402,18 +388,6 @@ if (defined $cgi->param('id')) { $first_bug->set_flags($flags, $new_flags); } -foreach my $b (@bug_objects) { - # Theoretically you could move a product without ever specifying - # a new assignee or qa_contact, or adding/removing any CCs. So, - # we have to check that the current assignee, qa, and CCs are still - # valid if we've switched products, under strict_isolation. We can only - # do that here. There ought to be some better way to do this, - # architecturally, but I haven't come up with it. - if ($product_change) { - $b->_check_strict_isolation(); - } -} - my $move_action = $cgi->param('action') || ''; if ($move_action eq Bugzilla->params->{'move-button-text'}) { Bugzilla->params->{'move-enabled'} || ThrowUserError("move_bugs_disabled"); -- cgit v1.2.1