diff options
author | lpsolit%gmail.com <> | 2008-12-17 16:07:28 +0100 |
---|---|---|
committer | lpsolit%gmail.com <> | 2008-12-17 16:07:28 +0100 |
commit | f0e753c84b83d9f0cc2391ed72e2456364a665bd (patch) | |
tree | 34a60196b9d9aa2d7f3ba1594501c0bd0ec59ad9 /attachment.cgi | |
parent | e27e9b2054a33e3c67a106401f7f0adc7ecf879f (diff) | |
download | bugzilla-f0e753c84b83d9f0cc2391ed72e2456364a665bd.tar.gz bugzilla-f0e753c84b83d9f0cc2391ed72e2456364a665bd.tar.xz |
Bug 467171: Editing attachments doesn't update the Last-Modified bug timestamp - Patch by A.A. Shimono <shimono@mozilla.gr.jp> r/a=LpSolit
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-x | attachment.cgi | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/attachment.cgi b/attachment.cgi index ec82b7fa4..35829343f 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -561,36 +561,49 @@ sub update { my $sth = $dbh->prepare('INSERT INTO bugs_activity (bug_id, attach_id, who, bug_when, fieldid, removed, added) VALUES (?, ?, ?, ?, ?, ?, ?)'); + # Flag for updating Last-Modified timestamp if record changed + my $updated = 0; if ($attachment->description ne $updated_attachment->description) { my $fieldid = get_field_id('attachments.description'); $sth->execute($bug->id, $attachment->id, $user->id, $timestamp, $fieldid, $attachment->description, $updated_attachment->description); + $updated = 1; } if ($attachment->contenttype ne $updated_attachment->contenttype) { my $fieldid = get_field_id('attachments.mimetype'); $sth->execute($bug->id, $attachment->id, $user->id, $timestamp, $fieldid, $attachment->contenttype, $updated_attachment->contenttype); + $updated = 1; } if ($attachment->filename ne $updated_attachment->filename) { my $fieldid = get_field_id('attachments.filename'); $sth->execute($bug->id, $attachment->id, $user->id, $timestamp, $fieldid, $attachment->filename, $updated_attachment->filename); + $updated = 1; } if ($attachment->ispatch != $updated_attachment->ispatch) { my $fieldid = get_field_id('attachments.ispatch'); $sth->execute($bug->id, $attachment->id, $user->id, $timestamp, $fieldid, $attachment->ispatch, $updated_attachment->ispatch); + $updated = 1; } if ($attachment->isobsolete != $updated_attachment->isobsolete) { my $fieldid = get_field_id('attachments.isobsolete'); $sth->execute($bug->id, $attachment->id, $user->id, $timestamp, $fieldid, $attachment->isobsolete, $updated_attachment->isobsolete); + $updated = 1; } if ($attachment->isprivate != $updated_attachment->isprivate) { my $fieldid = get_field_id('attachments.isprivate'); $sth->execute($bug->id, $attachment->id, $user->id, $timestamp, $fieldid, $attachment->isprivate, $updated_attachment->isprivate); + $updated = 1; + } + + if ($updated) { + $dbh->do("UPDATE bugs SET delta_ts = ? WHERE bug_id = ?", undef, + $timestamp, $bug->id); } # Commit the transaction now that we are finished updating the database. |