Bugzilla – Attachment 126241 Details for
Bug 21105
oai.pl returns invalid earliestDatestamp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21105: oai.pl returns invalid earliestDatestamp
Bug-21105-oaipl-returns-invalid-earliestDatestamp.patch (text/plain), 1.76 KB, created by
David Nind
on 2021-10-13 22:33:37 UTC
(
hide
)
Description:
Bug 21105: oai.pl returns invalid earliestDatestamp
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-10-13 22:33:37 UTC
Size:
1.76 KB
patch
obsolete
>From d7831cff65b1eef2b030f556fc1a4eba90af392b Mon Sep 17 00:00:00 2001 >From: dolf <rudolfbyker@gmail.com> >Date: Thu, 15 Apr 2021 09:32:30 +0200 >Subject: [PATCH] Bug 21105: oai.pl returns invalid earliestDatestamp > >For OAI-PMH, all date and time values must be in the format >"YYYY-MM-DDThh:mm:ssZ" and in UTC. Currently, >Identify.earliestDatestamp uses the SQL format "YYYY-MM-DD hh:mm:ss". >This patch fixes that. > >To test: >1) Get a Koha instance with OAI-PMH enabled. >2) Visit /cgi-bin/koha/oai.pl?verb=Identify, view source for the page > and observe that earliestDate is in the wrong format > "YYYY-MM-DD hh:mm:ss" >3) Apply patch >4) Visit /cgi-bin/koha/oai.pl?verb=Identify, view the source for the page > and observe that earliestDate is now in the correct format > "YYYY-MM-DDThh:mm:ssZ" >5) Sign off > >Sponsored-by: Reformational Study Centre > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/OAI/Server/Identify.pm | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/Koha/OAI/Server/Identify.pm b/Koha/OAI/Server/Identify.pm >index dc1a53086a..7afccef737 100644 >--- a/Koha/OAI/Server/Identify.pm >+++ b/Koha/OAI/Server/Identify.pm >@@ -54,7 +54,13 @@ sub new { > # will be returned and we will report the fallback 0001-01-01. > sub _get_earliest_datestamp { > my $dbh = C4::Context->dbh; >- my ( $earliest ) = $dbh->selectrow_array("SELECT MIN(timestamp) AS earliest FROM biblio" ); >+ # We do not need to perform timezone conversion here, because the time zone >+ # is set to UTC for the entire SQL session in Koha/OAI/Server/Repository.pm >+ my $query = q{ >+ SELECT DATE_FORMAT(MIN(timestamp), '%Y-%m-%dT%H:%i:%SZ') AS earliest >+ FROM biblio >+ }; >+ my ( $earliest ) = $dbh->selectrow_array($query); > return $earliest > } > >-- >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 21105
:
119604
|
119692
|
126236
|
126240
|
126241
|
127586
|
127587
|
127588
|
127589
|
127628
|
127644
|
127650
|
127653