diff options
author | lpsolit%gmail.com <> | 2006-02-25 07:53:30 +0100 |
---|---|---|
committer | lpsolit%gmail.com <> | 2006-02-25 07:53:30 +0100 |
commit | 0bd92669e6bd6cde59e85cbf9e827feb94d2536c (patch) | |
tree | a8fd330947eddfe0b18dbd5e6a1280384821168f /process_bug.cgi | |
parent | 80db88c9d89fe963ab407304849a3cd452fe1bef (diff) | |
download | bugzilla-0bd92669e6bd6cde59e85cbf9e827feb94d2536c.tar.gz bugzilla-0bd92669e6bd6cde59e85cbf9e827feb94d2536c.tar.xz |
Bug 328449: Remove BugMail::MessageToMTA() from Bug::RemoveVotes() - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-x | process_bug.cgi | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/process_bug.cgi b/process_bug.cgi index a489594f4..b3006565f 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -1960,7 +1960,10 @@ foreach my $id (@idlist) { # my $origOwner = ""; my $origQaContact = ""; - + + # $msgs will store emails which have to be sent to voters, if any. + my $msgs; + foreach my $c (@::log_columns) { my $col = $c; # We modify it, don't want to modify array # values in place. @@ -2004,10 +2007,13 @@ foreach my $id (@idlist) { } if ($col eq 'product') { - RemoveVotes($id, 0, - "This bug has been moved to a different product"); + # If some votes have been removed, RemoveVotes() returns + # a list of messages to send to voters. + # We delay the sending of these messages till tables are unlocked. + $msgs = RemoveVotes($id, 0, + "This bug has been moved to a different product"); } - + if ($col eq 'bug_status' && IsOpenedState($old) ne IsOpenedState($new)) { @@ -2026,6 +2032,11 @@ foreach my $id (@idlist) { } $dbh->bz_unlock_tables(); + # Now is a good time to send email to voters. + foreach my $msg (@$msgs) { + Bugzilla::BugMail::MessageToMTA($msg); + } + if ($duplicate) { # Check to see if Reporter of this bug is reporter of Dupe SendSQL("SELECT reporter FROM bugs WHERE bug_id = " . |