@@ -, +, @@ --- installer/data/mysql/atomicupdate/bug_20724.perl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/installer/data/mysql/atomicupdate/bug_20724.perl +++ a/installer/data/mysql/atomicupdate/bug_20724.perl @@ -1,7 +1,10 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { - my $sql = q|UPDATE reserves SET expirationdate = DATE_ADD( NOW(), INTERVAL ? DAY) WHERE expirationdate IS NULL AND waitingdate IS NOT NULL|; - $dbh->do( $sql, undef, C4::Context->preference('MaxPickupDelay') || 7 ); + my $dtf = Koha::Database->new->schema->storage->datetime_parser; + my $days = C4::Context->preference('MaxPickupDelay') || 7; + my $date = DateTime->now()->add( days => $days ); + my $sql = q|UPDATE reserves SET expirationdate = ? WHERE expirationdate IS NULL AND waitingdate IS NOT NULL|; + $dbh->do( $sql, undef, $dtf->format_datetime($date) ); SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 20724 - expirationdate filled for waiting holds)\n"; --