From f4ebaab9a44082475cf5c23b05b40ed8a56616ec Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 7 Oct 2021 14:31:10 +0000 Subject: [PATCH] Bug 29192: Set expirationdate as string when storing Hold To test: 1 - Enable HoldsLog in system preferences 2 - Set system preferences: DefaultHoldExpirationDate: Set DefaultHoldExpirationdatePeriod: 5 DefaultHoldExpirationdateUnitOfTime: days 3 - Create a hold for a patron 4 - Note the expiration date is set 5 - Check the action logs - SELECT * FROM action_logs 6 - Note that there is a lot of data, this is from DateTime object in expirationdate 7 - Apply patch 8 - Restart all 9 - Place another hold 10 - Confirm expiration date set correctly 11 - View the logs 12 - Entry for new hold contains only the date, no extra data --- Koha/Hold.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Hold.pm b/Koha/Hold.pm index 26c41d7924..54a5aba5a1 100644 --- a/Koha/Hold.pm +++ b/Koha/Hold.pm @@ -624,7 +624,7 @@ sub _set_default_expirationdate { C4::Context->preference('DefaultHoldExpirationdateUnitOfTime') || 'days'; $self->expirationdate( - dt_from_string( $self->reservedate )->add( $timeunit => $period ) ); + dt_from_string( $self->reservedate )->add( $timeunit => $period )->strftime("%Y-%m-%d") ); } =head3 _move_to_old -- 2.20.1