From: David Lawrence Date: Fri, 11 Feb 2011 21:51:23 +0000 (-0500) Subject: Bug 606511 - Bug.search should allow use of include_fields and exclude_fields X-Git-Tag: bugzilla-4.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=745fa5fafc86c40c1477a96c13b510e7eba8ff45;p=thirdparty%2Fbugzilla.git Bug 606511 - Bug.search should allow use of include_fields and exclude_fields r/a=mkanat --- diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index e966d0703b..0b5fe16c21 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -18,6 +18,7 @@ # Tsahi Asher # Noura Elhawary # Frank Becker +# Dave Lawrence package Bugzilla::WebService::Bug; @@ -429,9 +430,17 @@ 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 }; }