Add explicit sort to collections API with limit collections_limit_and_order
authorJeff Godin <jgodin@tadl.org>
Mon, 3 Jun 2013 20:03:11 +0000 (16:03 -0400)
committerJeff Godin <jgodin@tadl.org>
Mon, 3 Jun 2013 20:03:11 +0000 (16:03 -0400)
Add an explicit ORDER BY au.id ASC when limiting collections API
calls. This ensures that the same users will be returned on
subsequent calls, assuming no other relevant changes in the data.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Collections.pm

index 64f302f..69fc472 100644 (file)
@@ -252,7 +252,8 @@ sub users_of_interest_warning_penalty {
         $query->{limit} = $limit;
         my $sort_order = $sort || "DESC";
         $query->{order_by} = [
-            {class => 'ausp', field => 'set_date', direction => $sort_order}
+            {class => 'ausp', field => 'set_date', direction => $sort_order},
+            {class => 'au', field => 'id', direction => 'ASC'}
         ];
     }