summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService/Product.pm
diff options
context:
space:
mode:
authorSimon Green <sgreen@redhat.com>2013-02-15 15:16:48 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2013-02-15 15:16:48 +0100
commitaa73e4b5cf57c21c06c604375a7fcc6b5a981f3e (patch)
tree01b8ae84de246192d8ccc743a2cad72106d80b40 /Bugzilla/WebService/Product.pm
parent82bab122d14431f4bf3f1c31988434aec2386515 (diff)
downloadbugzilla-aa73e4b5cf57c21c06c604375a7fcc6b5a981f3e.tar.gz
bugzilla-aa73e4b5cf57c21c06c604375a7fcc6b5a981f3e.tar.xz
Bug 838846: In Product.get, include_fields => ['components'] no longer returns data about components
r/a=LpSolit
Diffstat (limited to 'Bugzilla/WebService/Product.pm')
-rw-r--r--Bugzilla/WebService/Product.pm36
1 files changed, 21 insertions, 15 deletions
diff --git a/Bugzilla/WebService/Product.pm b/Bugzilla/WebService/Product.pm
index fc48ecd88..755477acf 100644
--- a/Bugzilla/WebService/Product.pm
+++ b/Bugzilla/WebService/Product.pm
@@ -214,12 +214,12 @@ sub _product_to_hash {
}
if (filter_wants($params, 'versions')) {
$field_data->{versions} = [map {
- $self->_version_to_hash($_)
+ $self->_version_to_hash($_, $params)
} @{$product->versions}];
}
if (filter_wants($params, 'milestones')) {
$field_data->{milestones} = [map {
- $self->_milestone_to_hash($_)
+ $self->_milestone_to_hash($_, $params)
} @{$product->milestones}];
}
return filter($params, $field_data);
@@ -243,23 +243,26 @@ sub _component_to_hash {
0,
is_active =>
$self->type('boolean', $component->is_active),
- flag_types => {
+ };
+
+ if (filter_wants($params, 'flag_types', 'components')) {
+ $field_data->{flag_types} = {
bug =>
[map {
- $self->_flag_type_to_hash($_, $params)
+ $self->_flag_type_to_hash($_)
} @{$component->flag_types->{'bug'}}],
attachment =>
[map {
- $self->_flag_type_to_hash($_, $params)
+ $self->_flag_type_to_hash($_)
} @{$component->flag_types->{'attachment'}}],
- }
- };
- return filter($params, $field_data, 'component');
+ };
+ }
+ return filter($params, $field_data, 'components');
}
sub _flag_type_to_hash {
- my ($self, $flag_type, $params) = @_;
- my $field_data = {
+ my ($self, $flag_type) = @_;
+ return {
id =>
$self->type('int', $flag_type->id),
name =>
@@ -283,12 +286,11 @@ sub _flag_type_to_hash {
request_group =>
$self->type('int', $flag_type->request_group_id),
};
- return filter($params, $field_data, 'flag_type');
}
sub _version_to_hash {
- my ($self, $version) = @_;
- return {
+ my ($self, $version, $params) = @_;
+ my $field_data = {
id =>
$self->type('int', $version->id),
name =>
@@ -298,11 +300,12 @@ sub _version_to_hash {
is_active =>
$self->type('boolean', $version->is_active),
};
+ return filter($params, $field_data, 'versions');
}
sub _milestone_to_hash {
- my ($self, $milestone) = @_;
- return {
+ my ($self, $milestone, $params) = @_;
+ my $field_data = {
id =>
$self->type('int', $milestone->id),
name =>
@@ -312,6 +315,7 @@ sub _milestone_to_hash {
is_active =>
$self->type('boolean', $milestone->is_active),
};
+ return filter($params, $field_data, 'milestones');
}
1;
@@ -419,6 +423,8 @@ In addition to the parameters below, this method also accepts the
standard L<include_fields|Bugzilla::WebService/include_fields> and
L<exclude_fields|Bugzilla::WebService/exclude_fields> arguments.
+This RPC call supports sub field restrictions.
+
=over
=item C<ids>