From 3a713a97c7dd2e2029d07483e2308f23a4f1d514 Mon Sep 17 00:00:00 2001 From: The Minh Luong Date: Fri, 22 Apr 2022 09:35:23 -0400 Subject: [PATCH] Bug 17015: Check out with the useDaysMode preference When checking out with useDaysMode preference set to "Use the calendar to push the due date to the next open day", an error 500 appears. This patch fixes this error. To test: 1. Go in Administration->useDaysMode 2. Set this preference t0 "Use the calendar to push the due date to the next open day" 3. Make sure you have a patron and a item (note the patron's category and the item's type) 4. Make sure you have a circulation rule with the patron's category and the item type in step 3 5. Attempt a checkout 6. An error 500 appears 7. Apply the patch 8. The error is no longer there --- C4/Circulation.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 2adbcfdf7f..cce39dd996 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -3799,7 +3799,7 @@ sub CalcDateDue { my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branch, days_mode => $daysmode }); if ( $calendar->is_holiday($datedue) ) { # Don't return on a closed day - $datedue = $calendar->prev_open_days( $datedue )->set(hour => 23, minute => 59); + $datedue = $calendar->prev_open_day( $datedue )->set(hour => 23, minute => 59); } } } -- 2.25.1