From d0002e9626b97df6fad2c597b89c8ec31f7c308a Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 5 Aug 2009 12:35:50 +0000 Subject: Bug 415541: Implement $bug->set_flags() and $attachment->set_flags() - Patch by Frédéric Buclin a=LpSolit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process_bug.cgi | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'process_bug.cgi') diff --git a/process_bug.cgi b/process_bug.cgi index 9faaf7445..f10467d4e 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -143,22 +143,13 @@ if (defined $cgi->param('dontchange')) { } # do a match on the fields if applicable - -# The order of these function calls is important, as Flag::validate -# assumes User::match_field has ensured that the values -# in the requestee fields are legitimate user email addresses. -&Bugzilla::User::match_field($cgi, { +Bugzilla::User::match_field($cgi, { 'qa_contact' => { 'type' => 'single' }, 'newcc' => { 'type' => 'multi' }, 'masscc' => { 'type' => 'multi' }, 'assigned_to' => { 'type' => 'single' }, - '^requestee(_type)?-(\d+)$' => { 'type' => 'multi' }, }); -# Validate flags in all cases. validate() should not detect any -# reference to flags if $cgi->param('id') is undefined. -Bugzilla::Flag::validate($cgi->param('id')); - print $cgi->header() unless Bugzilla->usage_mode == USAGE_MODE_EMAIL; # Check for a mid-air collision. Currently this only works when updating @@ -280,6 +271,12 @@ foreach my $bug (@bug_objects) { $product_change ||= $changed; } +# Flags should be set AFTER the bug has been moved into another product/component. +if ($cgi->param('id')) { + my ($flags, $new_flags) = Bugzilla::Flag->extract_flags_from_cgi($first_bug, undef, $vars); + $first_bug->set_flags($flags, $new_flags); +} + if ($cgi->param('id') && (defined $cgi->param('dependson') || defined $cgi->param('blocked')) ) { @@ -586,9 +583,6 @@ foreach my $bug (@bug_objects) { CheckIfVotedConfirmed($bug->id); } - # Set and update flags. - Bugzilla::Flag->process($bug, undef, $timestamp, $vars); - $dbh->bz_commit_transaction(); ############### -- cgit v1.2.3-24-g4f1b