[Koha-patches] [PATCH] (bug #4195) fix OAI repository

Nahuel ANGELINETTI nahuel.angelinetti at biblibre.com
Tue Feb 16 14:34:58 CET 2010


this fix the OAI repository, to don't return resumptionToken if there is no more record.
---
 opac/oai.pl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/opac/oai.pl b/opac/oai.pl
index b4176ad..546623e 100755
--- a/opac/oai.pl
+++ b/opac/oai.pl
@@ -11,7 +11,7 @@ use C4::Context;
 
 BEGIN {
     eval { require PerlIO::gzip };
-    $GZIP = $@ ? 0 : 1;
+    $GZIP = ($@) ? 0 : 1;
 }
 
 unless ( C4::Context->preference('OAI-PMH') ) {
@@ -291,7 +291,7 @@ sub new {
         metadataPrefix  => $token->{metadata_prefix},
         from            => $token->{from},
         until           => $token->{until},
-        offset          => $pos ) );
+        offset          => $pos ) ) if ($pos > $token->{offset});
 
     return $self;
 }
@@ -338,7 +338,7 @@ sub new {
         metadataPrefix  => $token->{metadata_prefix},
         from            => $token->{from},
         until           => $token->{until},
-        offset          => $pos ) );
+        offset          => $pos ) ) if ($pos > $token->{offset});
 
     return $self;
 }
-- 
1.6.3.3




More information about the Koha-patches mailing list