Bugzilla – Attachment 123066 Details for
Bug 28741
OAI ListSets does not correctly build resumption token
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28741: Fix use of resumption token params
Bug-28741-Fix-use-of-resumption-token-params.patch (text/plain), 1.96 KB, created by
David Nind
on 2021-07-22 19:54:25 UTC
(
hide
)
Description:
Bug 28741: Fix use of resumption token params
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-07-22 19:54:25 UTC
Size:
1.96 KB
patch
obsolete
>From 0381cee05818e66e41fb99e3591e20f0a936d4f0 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 22 Jul 2021 17:56:39 +0000 >Subject: [PATCH] Bug 28741: Fix use of resumption token params > >TO test: > 1 - Enable OAI-PMH server in Koha > 2 - Set OAI-PMH:MaxCount to 5 > 3 - Define 6 sets in Admin->OAI sets configuration > Can setSpec and setName to 1,2,3.... > 4 - Browse to: > http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListSets > 5 - Click 'Show more' > 6 - Keep seeing the same 5 - note the page says 'Results fetched -4-0' > 7 - Apply patch > 8 - Restart all the things > 9 - Reload the ListSets URL above >10 - Click 'Show more' >11 - See the 6th set and note no 'Show more' >12 - Set OAI-PMH:MaxCount to 1 >13 - Go to the base ListSets url again >14 - Confirm you can 'Show more' until you reach the end > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/OAI/Server/ListSets.pm | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/Koha/OAI/Server/ListSets.pm b/Koha/OAI/Server/ListSets.pm >index 8a4be18ae4..504c0e3ebb 100644 >--- a/Koha/OAI/Server/ListSets.pm >+++ b/Koha/OAI/Server/ListSets.pm >@@ -35,7 +35,7 @@ sub new { > my $sets = GetOAISets; > my $pos = 0; > foreach my $set (@$sets) { >- if ($pos < $token->{offset}) { >+ if ($pos < $token->{next_id}) { > $pos++; > next; > } >@@ -50,15 +50,16 @@ sub new { > ) > ); > $pos++; >- last if ($pos + 1 - $token->{offset}) > $repository->{koha_max_count}; >+ last if ($pos + 1 - $token->{next_id}) > $repository->{koha_max_count}; > } > > $self->resumptionToken( > Koha::OAI::Server::ResumptionToken->new( > metadataPrefix => $token->{metadata_prefix}, >- offset => $pos >+ cursor => $pos, >+ next_id => $pos > ) >- ) if ( $pos > $token->{offset} ); >+ ) if ( $pos < scalar @$sets ); > > return $self; > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28741
:
123063
|
123066
|
123369
|
123382
|
123383
|
123384
|
124054