summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Lawrence <dkl@redhat.com>2010-10-26 23:14:57 +0200
committerDave Lawrence <dkl@redhat.com>2010-10-26 23:14:57 +0200
commitf2a3931c5f955bc2b26d3a6ee6e3fb55f6a27ee4 (patch)
tree446cab130c4263791d543cc43e41cf3cc6529e53
parent208390143d1c86d7cdb2f7ef51a9cedbc858ccff (diff)
downloadbugzilla-f2a3931c5f955bc2b26d3a6ee6e3fb55f6a27ee4.tar.gz
bugzilla-f2a3931c5f955bc2b26d3a6ee6e3fb55f6a27ee4.tar.xz
Bug 606511 - Bug.search should allow use of include_fields and exclude_fields
r=mkanat, a=mkanat
-rw-r--r--Bugzilla/WebService/Bug.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index 8477e33b2..372f0725f 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -18,6 +18,7 @@
# Tsahi Asher <tsahi_75@yahoo.com>
# Noura Elhawary <nelhawar@redhat.com>
# Frank Becker <Frank@Frank-Becker.de>
+# Dave Lawrence <dkl@redhat.com>
package Bugzilla::WebService::Bug;
@@ -427,8 +428,15 @@ sub search {
my $clause = join(' OR ', @likes);
$params->{WHERE}->{"($clause)"} = [map { "\%$_\%" } @strings];
}
-
- my $bugs = Bugzilla::Bug->match($params);
+
+ # We want include_fields and exclude_fields to be passed to
+ # _bug_to_hash but not to Bugzilla::Bug->match so we copy the
+ # params and delete those before passing to Bugzilla::Bug->match.
+ my %match_params = %{ $params };
+ delete $match_params{'include_fields'};
+ delete $match_params{'exclude_fields'};
+
+ my $bugs = Bugzilla::Bug->match(\%match_params);
my $visible = Bugzilla->user->visible_bugs($bugs);
my @hashes = map { $self->_bug_to_hash($_, $params) } @$visible;
return { bugs => \@hashes };