Bugzilla – Attachment 127996 Details for
Bug 29484
ListSets doesn't return noSetHierarchy when appropriate
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29484: Make ListSets return noSetHierarchy when no sets defined
Bug-29484-Make-ListSets-return-noSetHierarchy-when.patch (text/plain), 1.55 KB, created by
David Nind
on 2021-11-25 08:26:19 UTC
(
hide
)
Description:
Bug 29484: Make ListSets return noSetHierarchy when no sets defined
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-11-25 08:26:19 UTC
Size:
1.55 KB
patch
obsolete
>From c62611f72eb9f6c808599f28b53896a01164343d Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 15 Nov 2021 09:52:15 -0300 >Subject: [PATCH] Bug 29484: Make ListSets return noSetHierarchy when no sets > defined > >This simple patch makes our OAI-PMH server return the appropriate error >code when no sets are defined. > >To test: >1. Apply the regression tests >2. Run: > $ kshell > k$ t/db_dependent/OAI/Server.t >=> FAIL: Tests fail. Boo! >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! YAY! >5. Sign off :-D > >Bonus: you can check with the tool mentioned on the bug report, that >the error is gone. No sets need to be defined. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/OAI/Server/ListSets.pm | 11 +++++++++++ > 1 file changed, 11 insertions(+) > >diff --git a/Koha/OAI/Server/ListSets.pm b/Koha/OAI/Server/ListSets.pm >index 6fc245daeb..281fd23c57 100644 >--- a/Koha/OAI/Server/ListSets.pm >+++ b/Koha/OAI/Server/ListSets.pm >@@ -34,6 +34,17 @@ sub new { > my $token = Koha::OAI::Server::ResumptionToken->new(%args); > my $sets = GetOAISets; > my $pos = 0; >+ >+ return HTTP::OAI::Response->new( >+ requestURL => $repository->self_url(), >+ errors => [ >+ HTTP::OAI::Error->new( >+ code => 'noSetHierarchy', >+ message => 'There are no OAI sets defined', >+ ) >+ ], >+ ) unless scalar @{$sets} > 0; >+ > foreach my $set (@$sets) { > if ($pos < $token->{cursor}) { > $pos++; >-- >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 29484
:
127637
|
127638
|
127995
|
127996
|
128169
|
128170