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
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
}
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") ) {
- $expirationdate = $calendar->days_forward( dt_from_string(), $max_pickup_delay );
+ $expirationdate = $calendar->days_forward( dt_from_string($hold->waitingdate), $max_pickup_delay );
}
my $cmp = $requested_expiration ? DateTime->compare($requested_expiration, $expirationdate) : 0;