From d840af530f734a93903c37f6eea9972a6fe13e11 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 15 Nov 2017 13:03:57 +0000 Subject: [PATCH] Bug 19626 - Calculate expiration date for existing holds based on waitingdate To test: 1 - Have/create a 16.11 instance with some waiting holds 2 - Those holds should not have an expirationdate 3 - Make sure some of the holds are waiting longer than ReservesMaxPickupDelay BACKUP THE DB 4 - Upgrade to 17.05 (or later) 5 - Check the expirationdate for the holds 6 - The date wil be in the future (curdate + delay) 7 - Restore DB 8 - Apply patch 9 - Run the upgrade again 10 - expirationdate should now be based on waitingdate --- installer/data/mysql/updatedatabase.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index ec4eee4..e6a341f 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14371,7 +14371,7 @@ if( CheckVersion( $DBversion ) ) { } my $calendar = Koha::Calendar->new( branchcode => $hold->branchcode ); - my $expirationdate = dt_from_string(); + my $expirationdate = dt_from_string($hold->waitingdate); $expirationdate->add(days => $max_pickup_delay); if ( C4::Context->preference("ExcludeHolidaysFromMaxPickUpDelay") ) { -- 2.1.4