]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 574995: Make the WebService return reporter, attachment submitter, and
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 6 Jul 2010 22:09:24 +0000 (15:09 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 6 Jul 2010 22:09:24 +0000 (15:09 -0700)
commenter all as "creator"
r=timello, a=mkanat

Bugzilla/Bug.pm
Bugzilla/WebService/Bug.pm

index 08026f1a3bdae3aec96d2ae0946fd2f592179e2d..7d86fe328896278ff23e1316c1d1e05856991a13 100644 (file)
@@ -266,6 +266,7 @@ use constant MAX_LINE_LENGTH => 254;
 # use.)
 use constant FIELD_MAP => {
     creation_time    => 'creation_ts',
+    creator          => 'reporter',
     description      => 'comment',
     id               => 'bug_id',
     last_change_time => 'delta_ts',
index ec970a581c6502da1885291a0f91318f90adbad7..dd46d870e470f06560252f7b0d423a8762c82218 100644 (file)
@@ -290,6 +290,7 @@ sub _translate_comment {
     return filter $filters, {
         id         => $self->type('int', $comment->id),
         bug_id     => $self->type('int', $comment->bug_id),
+        creator    => $self->type('string', $comment->author->login),
         author     => $self->type('string', $comment->author->login),
         time       => $self->type('dateTime', $comment->creation_ts),
         is_private => $self->type('boolean', $comment->is_private),
@@ -695,8 +696,6 @@ sub _attachment_to_hash {
     # Skipping attachment flags for now.
     delete $attach->{flags};
 
-    my $attacher = new Bugzilla::User($attach->attacher->id);
-
     return filter $filters, {
         creation_time    => $self->type('dateTime', $attach->attached),
         last_change_time => $self->type('dateTime', $attach->modification_time),
@@ -709,7 +708,8 @@ sub _attachment_to_hash {
         is_obsolete      => $self->type('int', $attach->isobsolete),
         is_url           => $self->type('int', $attach->isurl),
         is_patch         => $self->type('int', $attach->ispatch),
-        attacher         => $self->type('string', $attacher->login)
+        creator          => $self->type('string', $attach->attacher->login),
+        attacher         => $self->type('string', $attach->attacher->login),
     };
 }
 
@@ -1098,10 +1098,14 @@ parameter enabled.
 
 C<boolean> True if the attachment is a patch, False otherwise.
 
-=item C<attacher>
+=item C<creator>
 
 C<string> The login name of the user that created the attachment.
 
+Also returned as C<attacher>, for backwards-compatibility with older
+Bugzillas. (However, this backwards-compatibility will go away in Bugzilla
+5.0.)
+
 =back
 
 =item B<Errors>
@@ -1125,6 +1129,9 @@ private attachments.
 
 =item Added in Bugzilla B<3.6>.
 
+=item In Bugzilla B<4.0>, the C<attacher> return value was renamed to
+C<creator>.
+
 =back
 
 =back
@@ -1219,10 +1226,14 @@ ID of that attachment. Otherwise it will be null.
 
 C<string> The actual text of the comment.
 
-=item author
+=item creator
 
 C<string> The login name of the comment's author.
 
+Also returned as C<author>, for backwards-compatibility with older
+Bugzillas. (However, this backwards-compatibility will go away in Bugzilla
+5.0.)
+
 =item time
 
 C<dateTime> The time (in Bugzilla's timezone) that the comment was added.
@@ -1263,6 +1274,9 @@ that id.
 
 =item C<attachment_id> was added to the return value in Bugzilla B<3.6>.
 
+=item In Bugzilla B<4.0>, the C<author> return value was renamed to
+C<creator>.
+
 =back
 
 =back
@@ -1643,6 +1657,10 @@ don't want this, be sure to also specify the C<product> argument.
 C<dateTime> Searches for bugs that were created at this time or later.
 May not be an array.
 
+=item C<creator>
+
+C<string> The login name of the user who created the bug.
+
 =item C<id>
 
 C<int> The numeric id of the bug.
@@ -1679,10 +1697,13 @@ C<string> The Priority field on a bug.
 
 C<string> The name of the Product that the bug is in.
 
-=item C<reporter>
+=item C<creator>
 
 C<string> The login name of the user who reported the bug.
 
+You can also pass this argument with the name C<reporter>, for
+backwards compatibility with older Bugzillas.
+
 =item C<resolution>
 
 C<string> The current resolution--only set if a bug is closed. You can
@@ -1763,6 +1784,9 @@ for that value.
 
 =item Searching by C<votes> was removed in Bugzilla B<4.0>.
 
+=item The C<reporter> input parameter was renamed to C<creator>
+in Bugzilla B<4.0>.
+
 =back
 
 =back