]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 918362 - The "order" parameter passed to Bug.search is ignored
authorDave Lawrence <dlawrence@mozilla.com>
Fri, 20 Sep 2013 14:20:52 +0000 (10:20 -0400)
committerDave Lawrence <dlawrence@mozilla.com>
Fri, 20 Sep 2013 14:20:52 +0000 (10:20 -0400)
r=LpSolit,a=glob

Bugzilla/WebService/Bug.pm

index 14d56713c1af8b7e970d368e6a8b44fac597ff22..eaca97f9117e4580204ca8425c34825370ff953e 100644 (file)
@@ -504,7 +504,7 @@ sub search {
         ThrowUserError('buglist_parameters_required');
     }
 
-    $options{order_columns} = [ split(/\s*,\s*/, delete $match_params{order}) ] if $match_params{order};
+    $options{order = [ split(/\s*,\s*/, delete $match_params{order}) ] if $match_params{order};
     $options{params} = \%match_params;
 
     my $search = new Bugzilla::Search(%options);
@@ -516,9 +516,9 @@ sub search {
 
     # Search.pm won't return bugs that the user shouldn't see so no filtering is needed.
     my @bug_ids = map { $_->[0] } @$data;
-    my $bug_objects = Bugzilla::Bug->new_from_list(\@bug_ids);
-
-    my @bugs = map { $self->_bug_to_hash($_, $params) } @$bug_objects;
+    my %bug_objects = map { $_->id => $_ } @{ Bugzilla::Bug->new_from_list(\@bug_ids) };
+    my @bugs = map { $bug_objects{$_} } @bug_ids;
+    @bugs = map { $self->_bug_to_hash($_, $params) } @bugs;
 
     return { bugs => \@bugs };
 }