From: Dave Lawrence Date: Tue, 26 Oct 2010 21:14:57 +0000 (-0400) Subject: Bug 606511 - Bug.search should allow use of include_fields and exclude_fields X-Git-Tag: bugzilla-4.1.1~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2a3931c5f955bc2b26d3a6ee6e3fb55f6a27ee4;p=thirdparty%2Fbugzilla.git Bug 606511 - Bug.search should allow use of include_fields and exclude_fields r=mkanat, a=mkanat --- diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 8477e33b29..372f0725f5 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; @@ -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 };