]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 606511 - Bug.search should allow use of include_fields and exclude_fields
authorDavid Lawrence <dlawrence@mozilla.com>
Fri, 11 Feb 2011 21:51:23 +0000 (16:51 -0500)
committerDavid Lawrence <dlawrence@mozilla.com>
Fri, 11 Feb 2011 21:51:23 +0000 (16:51 -0500)
r/a=mkanat

Bugzilla/WebService/Bug.pm

index e966d0703b48c4e35de273db6afa96a2f5e43881..0b5fe16c214d49870373d4742c1d0c656309548d 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;
 
@@ -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 };
 }