summaryrefslogtreecommitdiffstats
path: root/attachment.cgi
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-10-16 09:44:41 +0200
committerByron Jones <glob@mozilla.com>2014-10-16 09:44:41 +0200
commitaa749187ac2d97257d50e2f5326e21adb1e866a1 (patch)
treee95541360352af7306aa546849d3700ce573efe5 /attachment.cgi
parente8a33a1cc1de20fde76a236741f7171ebc03933d (diff)
downloadbugzilla-aa749187ac2d97257d50e2f5326e21adb1e866a1.tar.gz
bugzilla-aa749187ac2d97257d50e2f5326e21adb1e866a1.tar.xz
Bug 1082887: comments made when setting a flag from the attachment details page are not included in the "flag updated" email
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-xattachment.cgi13
1 files changed, 9 insertions, 4 deletions
diff --git a/attachment.cgi b/attachment.cgi
index 3ffcda821..d797c366d 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -581,7 +581,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');
@@ -610,6 +609,10 @@ sub insert {
}
$bug->update($timestamp);
+ # 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.
@@ -755,6 +758,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
@@ -762,9 +770,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();