]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 916979 - Bug.search ignores the "limit" parameter
authorDave Lawrence <dlawrence@mozilla.com>
Wed, 18 Sep 2013 15:08:32 +0000 (11:08 -0400)
committerDave Lawrence <dlawrence@mozilla.com>
Wed, 18 Sep 2013 15:08:32 +0000 (11:08 -0400)
a/r=glob

Bugzilla/Bug.pm
Bugzilla/WebService/Bug.pm

index 302b5859564ec78fdb502bac96b67798d3cba264..ba941788b3f47c7ba2f78aa8a11eb68ad6178590 100644 (file)
@@ -270,10 +270,6 @@ use constant FIELD_MAP => {
     summary          => 'short_desc',
     url              => 'bug_file_loc',
     whiteboard       => 'status_whiteboard',
-
-    # These are special values for the WebService Bug.search method.
-    limit            => 'LIMIT',
-    offset           => 'OFFSET',
 };
 
 use constant REQUIRED_FIELD_MAP => {
index fd8ea8fef321a85b521d657da3c5705c09df4585..14d56713c1af8b7e970d368e6a8b44fac597ff22 100644 (file)
@@ -493,19 +493,19 @@ sub search {
     }
 
     my %match_params = %{ $params };
-    delete $params->{include_fields};
-    delete $params->{exclude_fields};
+    delete $match_params{include_fields};
+    delete $match_params{exclude_fields};
 
     # If no other parameters have been passed other than limit and offset
     # then we throw error if system is configured to do so.
-    if (!grep(!/^(limit|offset)$/i, keys %$params)
+    if (!grep(!/^(limit|offset)$/, keys %match_params)
         && !Bugzilla->params->{search_allow_no_criteria})
     {
         ThrowUserError('buglist_parameters_required');
     }
 
-    $options{order_columns} = [ split(/\s*,\s*/, delete $params->{order}) ] if $params->{order};
-    $options{params} = $params;
+    $options{order_columns} = [ split(/\s*,\s*/, delete $match_params{order}) ] if $match_params{order};
+    $options{params} = \%match_params;
 
     my $search = new Bugzilla::Search(%options);
     my ($data) = $search->data;
@@ -518,7 +518,7 @@ sub search {
     my @bug_ids = map { $_->[0] } @$data;
     my $bug_objects = Bugzilla::Bug->new_from_list(\@bug_ids);
 
-    my @bugs = map { $self->_bug_to_hash($_, \%match_params) } @$bug_objects;
+    my @bugs = map { $self->_bug_to_hash($_, $params) } @$bug_objects;
 
     return { bugs => \@bugs };
 }