aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-02-07 10:46:55 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2015-02-07 10:46:55 -0800
commitc49dc322a89a57bd492b4fb34cf60978d01c14e9 (patch)
treeb4c8ec633f2cd9f7bd51bf736853505362ff9858 /attachment.cgi
parentMerge branch 'upstream', takes 4.4.6 fixes (diff)
parentMerge tag 'release-4.4.8' into upstream (diff)
downloadbugzilla-c49dc322a89a57bd492b4fb34cf60978d01c14e9.tar.gz
bugzilla-c49dc322a89a57bd492b4fb34cf60978d01c14e9.tar.bz2
bugzilla-c49dc322a89a57bd492b4fb34cf60978d01c14e9.zip
Merge remote-tracking branch 'origin/upstream'gentoo-4.4.8
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 9b5d66122..5902bcc46 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -549,7 +549,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');
@@ -580,6 +579,10 @@ sub insert {
$bug->add_cc($user) if $cgi->param('addselfcc');
$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.
@@ -702,6 +705,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
@@ -709,9 +717,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();