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:04:34 +0000 (12:04 -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/lib/OpenILS/Application/Search/Biblio.pm

index 780963b..dc45d3b 100644 (file)
@@ -956,7 +956,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(