summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-03-28 23:26:37 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-03-28 23:26:37 +0200
commit4c6220713993545fe6446a6853ca2ee66df32187 (patch)
treec2075ddeec41ca5afba1822e3dd993b86627ef5c /Bugzilla/WebService
parent52c568cc5617a2bca496350b1c61403b486e3bc9 (diff)
downloadbugzilla-4c6220713993545fe6446a6853ca2ee66df32187.tar.gz
bugzilla-4c6220713993545fe6446a6853ca2ee66df32187.tar.xz
Bug 554536: [WebService] Make Bug.fields not send the "values" item for
fields that don't have a list of values r=dkl, a=mkanat
Diffstat (limited to 'Bugzilla/WebService')
-rw-r--r--Bugzilla/WebService/Bug.pm14
1 files changed, 9 insertions, 5 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index d81bc2792..69de15cfd 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -98,10 +98,11 @@ sub fields {
my $value_field = $field->value_field
? $field->value_field->name : undef;
- my @values;
+ my (@values, $has_values);
if ( ($field->is_select and $field->name ne 'product')
or grep($_ eq $field->name, PRODUCT_SPECIFIC_FIELDS))
{
+ $has_values = 1;
@values = @{ $self->_legal_field_values({ field => $field }) };
}
@@ -109,7 +110,7 @@ sub fields {
$value_field = 'product';
}
- push (@fields_out, filter $params, {
+ my %field_data = (
id => $self->type('int', $field->id),
type => $self->type('int', $field->type),
is_custom => $self->type('boolean', $field->custom),
@@ -118,9 +119,12 @@ sub fields {
is_on_bug_entry => $self->type('boolean', $field->enter_bug),
visibility_field => $self->type('string', $visibility_field),
visibility_values => [$self->type('string', $visibility_value)],
- value_field => $self->type('string', $value_field),
- values => \@values,
- });
+ );
+ if ($has_values) {
+ $field_data{value_field} = $self->type('string', $value_field);
+ $field_data{values} = \@values;
+ };
+ push(@fields_out, filter $params, \%field_data);
}
return { fields => \@fields_out };