From e3c24d9549d04a90a24d08f463f19e7a933b5ff7 Mon Sep 17 00:00:00 2001 From: Didier Gautheron Date: Tue, 18 Aug 2020 07:40:50 +0200 Subject: [PATCH] Bug 26232: Empty smart rule fine grace period Staff can create smart rules with empty (undefined) fine grace period. In Overdues.pm undefined firstremind means 0, do the same in Circulation.pm. To test: 1. Apply these patches 2. Run: kshell prove t/db_dependent/Circulation.t Signed-off-by: Chris Cormack Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart (cherry picked from commit 7e66d6d190af4bd27739bdfe88049899f927c123) Signed-off-by: Lucas Gass --- C4/Circulation.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 23a609d05e..deee64c041 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2308,7 +2308,7 @@ sub _calculate_new_debar_dt { # grace period is measured in the same units as the loan my $grace = - DateTime::Duration->new( $unit => $issuing_rule->{firstremind} ); + DateTime::Duration->new( $unit => $issuing_rule->{firstremind} // 0); my $deltadays = DateTime::Duration->new( days => $chargeable_units -- 2.39.5