From 7412a3e38df8264658cd61cb3db2847d59e6f2d1 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Tue, 7 Apr 2026 16:35:22 +0300 Subject: [PATCH] Bug 42298: Automatic renewals should only respect the "No automatic renewals before" rule To test: 1. prove t/db_dependent/Circulation.t 2. Observe success Signed-off-by: David Nind Signed-off-by: Laura_Escamilla Signed-off-by: Lucas Gass --- C4/Circulation.pm | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index c3a056272f..2df439e96e 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -3494,17 +3494,13 @@ sub CanBookBeRenewed { # If its cron, tell it it's too soon for a an auto renewal return ( 0, $auto_renew, { soonest_renew_date => $soonest } ) if $cron; - - # Check if it's too soon for a manual renewal - my $soonestManual = GetSoonestRenewDate( $patron, $issue ); - if ( $soonestManual > dt_from_string() ) { - return ( 0, "too_soon", { soonest_renew_date => $soonestManual } ) unless $override_limit; - } } - $soonest = GetSoonestRenewDate( $patron, $issue ); - if ( $soonest > dt_from_string() ) { - return ( 0, "too_soon", { soonest_renew_date => $soonest } ) unless $override_limit; + unless ($cron) { + $soonest = GetSoonestRenewDate( $patron, $issue ); + if ( $soonest > dt_from_string() ) { + return ( 0, "too_soon", { soonest_renew_date => $soonest } ) unless $override_limit; + } } my $auto_renew_code =