aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-03-28 14:30:30 -0700
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-03-28 14:30:30 -0700
commit05ba0f410667684c973f325b7140448ed3528e2c (patch)
treeeecdb4fa7a5c8d70ef18c1eaa74dfb2dc6beaa4c /Bugzilla
parent4c6220713993545fe6446a6853ca2ee66df32187 (diff)
downloadbugs-05ba0f410667684c973f325b7140448ed3528e2c.tar
bugs-05ba0f410667684c973f325b7140448ed3528e2c.tar.gz
bugs-05ba0f410667684c973f325b7140448ed3528e2c.tar.bz2
bugs-05ba0f410667684c973f325b7140448ed3528e2c.tar.xz
bugs-05ba0f410667684c973f325b7140448ed3528e2c.zip
Bug 554560: WebService Bug.fields: Send visibility_values for all select-type
fields (including built-in fields that don't support it yet), but don't send a single null in the array for fields that have no visibility values. r=dkl, a=mkanat
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/WebService/Bug.pm18
1 files changed, 11 insertions, 7 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index 69de15cfd..934c08e15 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -93,8 +93,7 @@ sub fields {
foreach my $field (@fields) {
my $visibility_field = $field->visibility_field
? $field->visibility_field->name : undef;
- my $visibility_value = $field->visibility_value
- ? $field->visibility_value->name : undef;
+ my $vis_value = $field->visibility_value;
my $value_field = $field->value_field
? $field->value_field->name : undef;
@@ -118,7 +117,10 @@ 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 => [$self->type('string', $visibility_value)],
+ visibility_values => [
+ defined $vis_value ? $self->type('string', $vis_value->name)
+ : ()
+ ],
);
if ($has_values) {
$field_data{value_field} = $self->type('string', $value_field);
@@ -185,6 +187,7 @@ sub _legal_field_values {
is_open => $self->type('boolean', $status->is_open),
sortkey => $self->type('int', $status->sortkey),
can_change_to => \@can_change_to,
+ visibility_values => [],
});
}
}
@@ -192,13 +195,14 @@ sub _legal_field_values {
else {
my @values = Bugzilla::Field::Choice->type($field)->get_all();
foreach my $value (@values) {
- my $visibility_value = $value->visibility_value;
- my $vis_val_name = $visibility_value ? $visibility_value->name
- : undef;
+ my $vis_val = $value->visibility_value;
push(@result, {
name => $self->type('string', $value->name),
sortkey => $self->type('int' , $value->sortkey),
- visibility_values => [$self->type('string', $vis_val_name)],
+ visibility_values => [
+ defined $vis_val ? $self->type('string', $vis_val->name)
+ : ()
+ ],
});
}
}