diff options
author | Byron Jones <glob@mozilla.com> | 2014-10-16 15:31:39 +0800 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2014-10-16 15:31:39 +0800 |
commit | 17803aaaa873f274ea27fe84415b1ed5effbc974 (patch) | |
tree | f0740498de46970556ed813b5dd98fbf72c37b8a | |
parent | Bump version post-release (diff) | |
download | bugzilla-17803aaaa873f274ea27fe84415b1ed5effbc974.tar.gz bugzilla-17803aaaa873f274ea27fe84415b1ed5effbc974.tar.bz2 bugzilla-17803aaaa873f274ea27fe84415b1ed5effbc974.zip |
Bug 1082887: comments made when setting a flag from the attachment details page are not included in the "flag updated" email
r=dkl,a=glob
-rwxr-xr-x | attachment.cgi | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/attachment.cgi b/attachment.cgi index a6bda6a35..debd5f3eb 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -571,7 +571,6 @@ sub insert { my ($flags, $new_flags) = Bugzilla::Flag->extract_flags_from_cgi( $bug, $attachment, $vars, SKIP_REQUESTEE_ON_ERROR); $attachment->set_flags($flags, $new_flags); - $attachment->update($timestamp); # Insert a comment about the new attachment into the database. my $comment = $cgi->param('comment'); @@ -606,6 +605,10 @@ sub insert { ("create_attachment:" . $attachment->id, $token)); } + # We have to update the attachment after updating the bug, to ensure new + # comments are available. + $attachment->update($timestamp); + $dbh->bz_commit_transaction; # Define the variables and functions that will be passed to the UI template. @@ -729,6 +732,11 @@ sub update { # Figure out when the changes were made. my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); + # Commit the comment, if any. + # This has to happen before updating the attachment, to ensure new comments + # are available to $attachment->update. + $bug->update($timestamp); + if ($can_edit) { my $changes = $attachment->update($timestamp); # If there are changes, we updated delta_ts in the DB. We have to @@ -736,9 +744,6 @@ sub update { $bug->{delta_ts} = $timestamp if scalar(keys %$changes); } - # Commit the comment, if any. - $bug->update($timestamp); - # Commit the transaction now that we are finished updating the database. $dbh->bz_commit_transaction(); |