Commit 1f20953a authored by David Lawrence's avatar David Lawrence

Bug 989647 - Bug.update_attachment should allow for adding a comment when…

Bug 989647 - Bug.update_attachment should allow for adding a comment when updating attachment details similar to attachment.cgi r=glob,a=justdave
parent e1cf1772
......@@ -860,6 +860,7 @@ sub update_attachment {
}
my $flags = delete $params->{flags};
my $comment = delete $params->{comment};
# Update the values
foreach my $attachment (@attachments) {
......@@ -877,6 +878,13 @@ sub update_attachment {
foreach my $attachment (@attachments) {
my $changes = $attachment->update();
if ($comment = trim($comment)) {
$attachment->bug->add_comment($comment,
{ isprivate => $attachment->isprivate,
type => CMT_ATTACHMENT_UPDATED,
extra_data => $attachment->id });
}
$changes = translate($changes, ATTACHMENT_MAPPED_RETURNS);
my %hash = (
......@@ -904,7 +912,8 @@ sub update_attachment {
# Email users about the change
foreach my $bug (values %bugs) {
Bugzilla::BugMail::Send($bug->id, { 'changer' => $user });
$bug->update();
$bug->send_changes();
}
# Return the information to the user
......@@ -3589,6 +3598,10 @@ in the UI for this attachment.
C<string> A short string describing the
attachment.
=item C<comment>
C<string> An optional comment to add to the attachment's bug.
=item C<content_type>
C<string> The MIME type of the attachment, like
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment