Z39.50 local catalog fetch-more repairs
authorBill Erickson <berick@esilibrary.com>
Wed, 5 Oct 2011 13:39:47 +0000 (09:39 -0400)
committerJason Etheridge <jason@esilibrary.com>
Thu, 27 Oct 2011 16:09:18 +0000 (12:09 -0400)
Fixes the following problem:

When paging through local catalog results in the Z39.50 interface,
paging off then end of the local results would result in an unknown
server error caused by trying to retrieve an empty list of records.

$list->{count} in this context is the overall hit count, not the counts
in the current page of results.  Note also if {count} is zero, the list
of IDs will be undef, so we use both.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm

index d83f0f6..005eb01 100644 (file)
@@ -852,7 +852,7 @@ sub cat_search_z_style_wrapper {
 
        my $list = the_quest_for_knowledge( $self, $client, $searchhash );
 
-       if ($list->{count} > 0) {
+       if ($list->{count} > 0 and @{$list->{ids}}) {
                $result->{count} = $list->{count};
 
                my $records = $cstore->request(