Browse Source

Bug 21105: (QA follow-up) Avoid MySQL-ism

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.11/bug30761
Tomás Cohen Arazi 2 years ago
committed by Jonathan Druart
parent
commit
38f1901461
  1. 12
      Koha/OAI/Server/Identify.pm

12
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;

Loading…
Cancel
Save