Bug 606511 - Bug.search should allow use of include_fields and exclude_fields

r=mkanat, a=mkanat


git-svn-id: svn://10.0.0.236/trunk@261464 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkanat%bugzilla.org
2010-10-26 21:31:41 +00:00
parent 54bf2898e9
commit 5cf7b835c3
2 changed files with 11 additions and 3 deletions

View File

@@ -1 +1 @@
7572
7573

View File

@@ -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 };