@@ -, +, @@ Provider --------- -- should fail -- should pass --- Koha/OAI/Server/Repository.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/Koha/OAI/Server/Repository.pm +++ a/Koha/OAI/Server/Repository.pm @@ -115,6 +115,10 @@ sub new { # OAI-PMH handles dates in UTC, so do that on the database level to avoid need for # any conversions + my $sth = C4::Context->dbh->prepare('SELECT @@session.time_zone'); + $sth->execute(); + my ( $orig_tz ) = $sth->fetchrow(); + $self->{ mysql_orig_tz } = $orig_tz; C4::Context->dbh->prepare("SET time_zone='+00:00'")->execute(); # Check for grammatical errors in the request @@ -152,6 +156,15 @@ sub new { } +sub DESTROY { + my ( $self ) = @_; + + # Reset time zone to the original value + C4::Context->dbh->prepare("SET time_zone='" . $self->{ mysql_orig_tz } . "'")->execute() + if $self->{ mysql_orig_tz }; +} + + sub get_biblio_marcxml { my ($self, $biblionumber, $format) = @_; my $with_items = 0; --