summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/WebService')
-rw-r--r--Bugzilla/WebService/Bug.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index 934c08e15..240eee91e 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -79,14 +79,16 @@ sub fields {
my $names = $params->{names};
foreach my $field_name (@$names) {
my $loop_field = Bugzilla::Field->check($field_name);
- push(@fields, $loop_field);
+ # 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);
+ }
}
}
- if (!defined $params->{ids}
- and !defined $params->{names})
- {
- @fields = @{Bugzilla::Field->match({obsolete => 0})};
+ if (!defined $params->{ids} and !defined $params->{names}) {
+ @fields = Bugzilla->get_fields({ obsolete => 0 });
}
my @fields_out;