Bug 916979 - Bug.search ignores the "limit" parameter

a/r=glob


git-svn-id: svn://10.0.0.236/trunk@265017 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzrmirror%bugzilla.org
2013-09-18 15:18:07 +00:00
parent 9c86a83a1c
commit 265af1fdb1
3 changed files with 7 additions and 11 deletions

View 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 };
}