From b7b88d679bc77fd887069fc947d91f8c3f58dc8a Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 22 Jul 2009 21:35:46 +0000 Subject: [PATCH] Bug 505484: Fix the return value of Bug.history to be more like the return value of Bug.get Patch by Max Kanat-Alexander r=dkl, r=LpSolit, a=mkanat --- Bugzilla/WebService/Bug.pm | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 0ebf236719..8e712ff3ad 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -191,14 +191,16 @@ sub history { defined $ids || ThrowCodeError('param_required', { param => 'ids' }); my @return; + foreach my $bug_id (@$ids) { my %item; my $bug = Bugzilla::Bug->check($bug_id); $bug_id = $bug->id; + $item{id} = $self->type('int', $bug_id); my ($activity) = Bugzilla::Bug::GetBugActivity($bug_id); - $item{$bug_id} = []; + my @history; foreach my $changeset (@$activity) { my %bug_history; $bug_history{when} = $self->type('dateTime', @@ -220,8 +222,10 @@ sub history { push (@{$bug_history{changes}}, $change); } - push (@{$item{$bug_id}}, \%bug_history); - } + push (@history, \%bug_history); + } + + $item{history} = \@history; # alias is returned in case users passes a mixture of ids and aliases # then they get to know which bug activity relates to which value @@ -933,17 +937,26 @@ try to specify an alias. (It will be error 100.) =item B -A hash containing a single element, C. This is a hash of hashes. -Each hash has the numeric bug id as a key, and contains the following -items: +A hash containing a single element, C. This is an array of hashes, +containing the following keys: =over +=item id + +C The numeric id of the bug. + =item alias C The alias of this bug. If there is no alias or aliases are disabled in this Bugzilla, this will be undef. +=item history + +C An array of hashes, each hash having the following keys: + +=over + =item when C The date the bug activity/change happened. @@ -983,6 +996,8 @@ present in this hash. =back +=back + =item B The same as L. -- 2.47.2