@@ -, +, @@
- 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
No records match the given criteria
- Check a good query returns still results
- Same test with ListIdentifiers verb
---
opac/oai.pl | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
--- a/opac/oai.pl
+++ a/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;
}
--