From a24c17a2aa2053da1317c29e47a3946af2962afb Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 4 Oct 2019 14:06:27 +0100 Subject: [PATCH] Bug 23551: Fix AddRenewal call in circ/renew.pl Without the patch, renewing from the renewal tab/page led to wrong renewal/due dates. To test: - Check an item out to your patron account - Renew it from the patron account - Note the due date - Return the item - Check the item out again - Renew it using the renewal tab - Verify a different due date was calculated - Apply patch - Repeat test - due dates now should be the same Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- circ/renew.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/circ/renew.pl b/circ/renew.pl index a431a2c4a3..df1e043bdb 100755 --- a/circ/renew.pl +++ b/circ/renew.pl @@ -95,7 +95,11 @@ if ($barcode) { } if ($can_renew) { my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; - my $date_due = AddRenewal( undef, $item->itemnumber(), $branchcode, dt_from_string( scalar $cgi->param('renewonholdduedate')) ); + my $date_due; + if ( $cgi->param('renewonholdduedate') ) { + $date_due = dt_from_string( scalar $cgi->param('renewonholdduedate')); + } + $date_due = AddRenewal( undef, $item->itemnumber(), $branchcode, $date_due ); $template->param( date_due => $date_due ); } } -- 2.39.5