]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 606511 - Bug.search should allow use of include_fields and exclude_fields
authorDave Lawrence <dkl@redhat.com>
Tue, 26 Oct 2010 21:14:57 +0000 (17:14 -0400)
committerDave Lawrence <dkl@redhat.com>
Tue, 26 Oct 2010 21:14:57 +0000 (17:14 -0400)
r=mkanat, a=mkanat

Bugzilla/WebService/Bug.pm

index 8477e33b297904f3f4303b8198c725cfdb4dfeb9..372f0725f56f5ee23688630e93c6fc29baa165d3 100644 (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 };