From 5411bc1ba8203397145737a5ef5fe7faba57eb87 Mon Sep 17 00:00:00 2001 From: Frank Becker Date: Thu, 29 Mar 2012 18:33:46 -0400 Subject: Bug 690879 - Webservice Bug.fields should include include keyword name and description as legal values --- Bugzilla/WebService/Bug.pm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'Bugzilla/WebService/Bug.pm') diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 243031800..53299566f 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -119,11 +119,12 @@ sub fields { my (@values, $has_values); if ( ($field->is_select and $field->name ne 'product') - or grep($_ eq $field->name, PRODUCT_SPECIFIC_FIELDS)) + or grep($_ eq $field->name, PRODUCT_SPECIFIC_FIELDS) + or $field->name eq 'keywords') { $has_values = 1; @values = @{ $self->_legal_field_values({ field => $field }) }; - } + } if (grep($_ eq $field->name, PRODUCT_SPECIFIC_FIELDS)) { $value_field = 'product'; @@ -213,6 +214,15 @@ sub _legal_field_values { } } + elsif ($field_name eq 'keywords') { + my @legal_keywords = Bugzilla::Keyword->get_all; + foreach my $value (@legal_keywords) { + push (@result, { + name => $self->type('string', $value->name), + description => $self->type('string', $value->description), + }); + } + } else { my @values = Bugzilla::Field::Choice->type($field)->get_all(); foreach my $value (@values) { @@ -1176,7 +1186,7 @@ values of the field are shown in the user interface. Can be null. This is an array of hashes, representing the legal values for select-type (drop-down and multiple-selection) fields. This is also -populated for the C, C, and C +populated for the C, C, C, and C fields, but not for the C field (you must use L for that. @@ -1209,6 +1219,11 @@ if the C is set to one of the values listed in this array. Note that for per-product fields, C is set to C<'product'> and C will reflect which product(s) this value appears in. +=item C + +C The description of the value. This item is only included for the +C field. + =item C C For C values, determines whether this status -- cgit v1.2.3-24-g4f1b