aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2014-03-31 15:51:20 +0000
committerDavid Lawrence <dkl@mozilla.com>2014-03-31 15:51:20 +0000
commit1f20953a72a1c653fe4f4ea0a77884d91f2fffe8 (patch)
tree7e84498f98af389db54b2e3fb432fd1d7c4f08df /Bugzilla/WebService
parente1cf17721a4588d177f3b59c5bed61bdf918afeb (diff)
downloadbugs-1f20953a72a1c653fe4f4ea0a77884d91f2fffe8.tar
bugs-1f20953a72a1c653fe4f4ea0a77884d91f2fffe8.tar.gz
bugs-1f20953a72a1c653fe4f4ea0a77884d91f2fffe8.tar.bz2
bugs-1f20953a72a1c653fe4f4ea0a77884d91f2fffe8.tar.xz
bugs-1f20953a72a1c653fe4f4ea0a77884d91f2fffe8.zip
Bug 989647 - Bug.update_attachment should allow for adding a comment when updating attachment details similar to attachment.cgi
r=glob,a=justdave
Diffstat (limited to 'Bugzilla/WebService')
-rw-r--r--Bugzilla/WebService/Bug.pm15
1 files changed, 14 insertions, 1 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index 3af8169b4..204e31183 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -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