Give the recent_changes list the ability to sort authority records correctly
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Dec 2010 06:40:26 +0000 (06:40 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Dec 2010 06:40:26 +0000 (06:40 +0000)
We were always sorting by bibliographic record entry, which does not
work all that well for authority records.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@18940 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm

index f88ad6c..2f52bdf 100644 (file)
@@ -1974,7 +1974,12 @@ sub recent_changes {
        my $limit = shift;
 
        my $type = 'biblio';
-       $type = 'authority' if ($self->api_name =~ /authority/o);
+       my $hint = 'bre';
+
+       if ($self->api_name =~ /authority/o) {
+               $type = 'authority';
+               $hint = 'are';
+       }
 
        my $axis = 'create_date';
        $axis = 'edit_date' if ($self->api_name =~ /edit/o);
@@ -1984,7 +1989,7 @@ sub recent_changes {
        return $_storage->request(
                "open-ils.cstore.direct.$type.record_entry.id_list.atomic",
                { $axis => { ">" => $when }, id => { '>' => 0 } },
-               { order_by => { bre => "$axis desc" }, limit => $limit }
+               { order_by => { $hint => "$axis desc" }, limit => $limit }
        )->gather(1);
 }