From d0f918d2bbe79c26bf7e9d3c3a3726a813bea9b3 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 23 Aug 2021 18:56:35 +0000 Subject: [PATCH] Bug 28741: [20.11.x] Fix warning and position check --- Koha/OAI/Server/ListSets.pm | 2 +- Koha/OAI/Server/ResumptionToken.pm | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Koha/OAI/Server/ListSets.pm b/Koha/OAI/Server/ListSets.pm index 68264787f1..33fa63d043 100644 --- a/Koha/OAI/Server/ListSets.pm +++ b/Koha/OAI/Server/ListSets.pm @@ -58,7 +58,7 @@ sub new { metadataPrefix => $token->{metadata_prefix}, offset => $pos ) - ) if ( $pos > $token->{offset} ); + ) if ( $pos < scalar @$sets ); return $self; } diff --git a/Koha/OAI/Server/ResumptionToken.pm b/Koha/OAI/Server/ResumptionToken.pm index ee97771ca5..6d310c4e60 100644 --- a/Koha/OAI/Server/ResumptionToken.pm +++ b/Koha/OAI/Server/ResumptionToken.pm @@ -61,6 +61,9 @@ sub new { $deleted_count = defined $args{ deleted_count } ? $args{ deleted_count } : 0; } + # metadata_prefix can be undef (e.g. listSets) + $metadata_prefix //= ''; + $self->{ metadata_prefix } = $metadata_prefix; $self->{ offset } = $offset; $self->{ from } = $from; -- 2.20.1