Bugzilla – Attachment 42404 Details for
Bug 14721
OAI-PMH must return error when no results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14721 - OAI-PMH must return error when no results
Bug-14721---OAI-PMH-must-return-error-when-no-resu.patch (text/plain), 1.79 KB, created by
Jonathan Druart
on 2015-09-04 13:58:08 UTC
(
hide
)
Description:
Bug 14721 - OAI-PMH must return error when no results
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-09-04 13:58:08 UTC
Size:
1.79 KB
patch
obsolete
>From 0e204f0f32f4bcae2fdb42cc4493423363191b08 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 25 Aug 2015 11:33:04 +0200 >Subject: [PATCH] Bug 14721 - OAI-PMH must return error when no results > >When getting records from OAI-PMH, an error must be returned if there is no results. > >See : http://www.openarchives.org/OAI/openarchivesprotocol.html#ErrorConditions > >Test plan : >- Enable OAI webservice >- Perform a query that will return no results. ie : /cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marcxml&from=2099-12-30&until=2099-12-31 >=> Without patch you get a response with : > <ListRecords/> >=> With patch you get a response with error code : > <error code="noRecordsMatch">No records match the given criteria</error> >- Check a good query returns still results >- Same test with ListIdentifiers verb > >Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > opac/oai.pl | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > >diff --git a/opac/oai.pl b/opac/oai.pl >index ab56d79..573f01a 100755 >--- a/opac/oai.pl >+++ b/opac/oai.pl >@@ -411,6 +411,14 @@ sub new { > ) ); > } > >+ # Return error if no results >+ unless ($count) { >+ return HTTP::OAI::Response->new( >+ requestURL => $repository->self_url(), >+ errors => [ new HTTP::OAI::Error( code => 'noRecordsMatch' ) ], >+ ); >+ } >+ > return $self; > } > >@@ -586,6 +594,14 @@ sub new { > } > } > >+ # Return error if no results >+ unless ($count) { >+ return HTTP::OAI::Response->new( >+ requestURL => $repository->self_url(), >+ errors => [ new HTTP::OAI::Error( code => 'noRecordsMatch' ) ], >+ ); >+ } >+ > return $self; > } > >-- >2.1.0
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 14721
:
41887
|
42389
| 42404