From 7bc9beb49b8e2c42d584a0cafaa52fe5dfacd797 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Sun, 28 Mar 2010 21:37:11 +0000 Subject: [PATCH] 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 git-svn-id: svn://10.0.0.236/trunk@260073 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- .../webtools/bugzilla/Bugzilla/WebService/Bug.pm | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 819c0faabfd..9da679d0071 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -7088 \ No newline at end of file +7089 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm index d81bc2792dd..69de15cfd86 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm +++ b/mozilla/webtools/bugzilla/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 };