From 1f6214a9f98c9f419222ee7e7b6fdcb7126a485b Mon Sep 17 00:00:00 2001 From: Tiago Mello Date: Sun, 24 Oct 2010 19:21:00 -0200 Subject: Bug 598549: Fixes the visibility_values in the WS Bug.fields method. r/a=mkanat --- Bugzilla/WebService/Bug.pm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'Bugzilla/WebService') diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 45395ae1e..8477e33b2 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -109,9 +109,9 @@ sub fields { my @fields_out; foreach my $field (@fields) { - my $visibility_field = $field->visibility_field + my $visibility_field = $field->visibility_field ? $field->visibility_field->name : undef; - my $vis_value = $field->visibility_value; + my $vis_values = $field->visibility_values; my $value_field = $field->value_field ? $field->value_field->name : undef; @@ -135,10 +135,8 @@ sub fields { display_name => $self->type('string', $field->description), is_on_bug_entry => $self->type('boolean', $field->enter_bug), visibility_field => $self->type('string', $visibility_field), - visibility_values => [ - defined $vis_value ? $self->type('string', $vis_value->name) - : () - ], + visibility_values => + [ map { $self->type('string', $_->name) } @$vis_values ], ); if ($has_values) { $field_data{value_field} = $self->type('string', $value_field); -- cgit v1.2.3-24-g4f1b