patched some logic bugs
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 30 Jun 2006 21:18:13 +0000 (21:18 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 30 Jun 2006 21:18:13 +0000 (21:18 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4875 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm

index 469cf06..ec96fa4 100644 (file)
@@ -409,7 +409,7 @@ sub the_quest_for_knowledge {
 
                my @t;
                for ($offset..$end) {
-                       last if $end > scalar(@recs);
+                       last if $_ > scalar(@recs);
                        push(@t, $recs[$_]) if $recs[$_];
                }
                @recs = @t;
@@ -438,6 +438,7 @@ sub search_cache {
        return undef unless $cache;
        my $data = $cache->get_cache($key);
 
+       #return undef unless $data and ref $data eq 'ARRAY' and $$data[$start] and $$data[$end];
        return undef unless $data and ref $data eq 'ARRAY' and $$data[$start] and $$data[$end];
 
        #$logger->debug("search_cache found data " . JSON->perl2JSON($data));
@@ -894,7 +895,7 @@ sub marc_search {
        my $recs = search_cache($ckey, $offset, $limit);
 
        if(!$recs) {
-               $recs = new_editor()->request($method, %$args);
+               $recs = $U->storagereq($method, %$args);
                put_cache($ckey, $recs);
                $recs = [ @$recs[$offset..($offset + ($limit - 1))] ];
        }