diff options
author | lpsolit%gmail.com <> | 2005-06-09 06:04:22 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-06-09 06:04:22 +0200 |
commit | b2ced74b4357baa441e73c8d09858925635dba4a (patch) | |
tree | 378d42fb1632d0deea7fc1738d9a2cf11ceb3c7e /process_bug.cgi | |
parent | 147d5680bff01ee01c5f56d226d211e864f67ed2 (diff) | |
download | bugzilla-b2ced74b4357baa441e73c8d09858925635dba4a.tar.gz bugzilla-b2ced74b4357baa441e73c8d09858925635dba4a.tar.xz |
Bug 225042: If sendmail dies while processing a duplicate it corrupts the duplicates table - Patch by Frédéric Buclin <LpSolit@gmail.com> r=vladd a=justdave
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-x | process_bug.cgi | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/process_bug.cgi b/process_bug.cgi index b9dab876a..7b0dd6a8a 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -1805,19 +1805,6 @@ foreach my $id (@idlist) { } $dbh->bz_unlock_tables(); - $vars->{'mailrecipients'} = { 'cc' => \@ccRemoved, - 'owner' => $origOwner, - 'qacontact' => $origQaContact, - 'changer' => Bugzilla->user->login }; - - $vars->{'id'} = $id; - - # Let the user know the bug was changed and who did and didn't - # receive email about the change. - $template->process("bug/process/results.html.tmpl", $vars) - || ThrowTemplateError($template->error()); - $vars->{'header_done'} = 1; - if ($duplicate) { # Check to see if Reporter of this bug is reporter of Dupe SendSQL("SELECT reporter FROM bugs WHERE bug_id = " . @@ -1847,7 +1834,26 @@ foreach my $id (@idlist) { CheckFormFieldDefined($cgi,'comment'); SendSQL("INSERT INTO duplicates VALUES ($duplicate, " . $cgi->param('id') . ")"); - + } + + # Now all changes to the DB have been made. It's time to email + # all concerned users, including the bug itself, but also the + # duplicated bug and dependent bugs, if any. + + $vars->{'mailrecipients'} = { 'cc' => \@ccRemoved, + 'owner' => $origOwner, + 'qacontact' => $origQaContact, + 'changer' => Bugzilla->user->login }; + + $vars->{'id'} = $id; + + # Let the user know the bug was changed and who did and didn't + # receive email about the change. + $template->process("bug/process/results.html.tmpl", $vars) + || ThrowTemplateError($template->error()); + $vars->{'header_done'} = 1; + + if ($duplicate) { $vars->{'mailrecipients'} = { 'changer' => Bugzilla->user->login }; $vars->{'id'} = $duplicate; |