Commit 6463e47b authored by Max Kanat-Alexander's avatar Max Kanat-Alexander

Bug 554569: WebService Bug.fields: Make it so that if you request a field

by both id and name, only one field is returned r=dkl, a=mkanat
parent 05ba0f41
...@@ -79,14 +79,16 @@ sub fields { ...@@ -79,14 +79,16 @@ sub fields {
my $names = $params->{names}; my $names = $params->{names};
foreach my $field_name (@$names) { foreach my $field_name (@$names) {
my $loop_field = Bugzilla::Field->check($field_name); my $loop_field = Bugzilla::Field->check($field_name);
# Don't push in duplicate fields if we also asked for this field
# in "ids".
if (!grep($_->id == $loop_field->id, @fields)) {
push(@fields, $loop_field); push(@fields, $loop_field);
} }
} }
}
if (!defined $params->{ids} if (!defined $params->{ids} and !defined $params->{names}) {
and !defined $params->{names}) @fields = Bugzilla->get_fields({ obsolete => 0 });
{
@fields = @{Bugzilla::Field->match({obsolete => 0})};
} }
my @fields_out; my @fields_out;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment