Fix negative paging issue in open-ils.supercat.authority.author.startwith
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 15 Nov 2010 04:50:22 +0000 (04:50 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 15 Nov 2010 04:50:22 +0000 (04:50 +0000)
When paging backwards through authority lists, we were skipping the
first page of results. By reducing the offset by the value of one
page, we restore the expected order.

The same problem might affect other paging interfaces: to be determined.

Closes Launchpad bug 669247

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

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

index 8806980..3b7eba8 100644 (file)
@@ -1365,6 +1365,9 @@ sub authority_tag_sf_startwith {
        my @list = ();
 
        if ($page < 0) {
+               # Don't skip the first actual page of results in descending order
+               $offset = $offset - $limit;
+
                my $before = $_storage->request(
                        "open-ils.cstore.json_query.atomic",
                        { select        => { afr => [qw/record value/] },