Bugzilla – Attachment 127589 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: (QA follow-up) Avoid MySQL-ism
Bug-21105-QA-follow-up-Avoid-MySQL-ism.patch (text/plain), 1.35 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-11-12 14:37:55 UTC
(
hide
)
Description:
Bug 21105: (QA follow-up) Avoid MySQL-ism
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-11-12 14:37:55 UTC
Size:
1.35 KB
patch
obsolete
>From 29a1f2d45d75de33fa88db07e16a7b9c36271d49 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 12 Nov 2021 11:34:58 -0300 >Subject: [PATCH] Bug 21105: (QA follow-up) Avoid MySQL-ism > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/OAI/Server/Identify.pm | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > >diff --git a/Koha/OAI/Server/Identify.pm b/Koha/OAI/Server/Identify.pm >index a44df73b40..b98a4c09e7 100644 >--- a/Koha/OAI/Server/Identify.pm >+++ b/Koha/OAI/Server/Identify.pm >@@ -20,8 +20,10 @@ > package Koha::OAI::Server::Identify; > > use Modern::Perl; >+ > use HTTP::OAI; > use C4::Context; >+use Koha::DateUtils qw(dt_from_string); > > use base ("HTTP::OAI::Identify"); > >@@ -59,12 +61,12 @@ sub _get_earliest_datestamp { > my $dbh = C4::Context->dbh; > # 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 >+ my ( $earliest ) = $dbh->selectrow_array(q{ >+ SELECT MIN(timestamp) AS earliest > FROM biblio >- }; >- my ( $earliest ) = $dbh->selectrow_array($query); >- return $earliest >+ }); >+ >+ return dt_from_string( $earliest, 'sql' )->strftime('%FT%TZ'); > } > > 1; >-- >2.32.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 21105
:
119604
|
119692
|
126236
|
126240
|
126241
|
127586
|
127587
|
127588
| 127589 |
127628
|
127644
|
127650
|
127653