From 7d75be1fb3a173a8f399d3263102e428659c5885 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Sun, 8 Jul 2018 00:53:45 +0000 Subject: [PATCH] Bug 19532 - Fix for recall OPAC confirmation failing when recall circ rule is empty Sponsored-BY: Catalyst IT --- opac/opac-recall.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/opac/opac-recall.pl b/opac/opac-recall.pl index ce3811377a..40a02ff54b 100755 --- a/opac/opac-recall.pl +++ b/opac/opac-recall.pl @@ -87,9 +87,12 @@ if ($op eq 'request'){ my $recall = Koha::Recalls->find($recall_request->recall_id); # updating due date on checkout my $timestamp = dt_from_string($recall->timestamp); - my $due_date = $timestamp->add( $issuing_rule->lengthunit => $issuing_rule->recall_due_date_interval ); - - $checkout->update({ date_due => $due_date }); + if ($issuing_rule->recall_due_date_interval eq '') { + my $due_date = $timestamp->add( $issuing_rule->lengthunit => 0 ); + } else { + my $due_date = $timestamp->add( $issuing_rule->lengthunit => $issuing_rule->recall_due_date_interval); + } + my $checkout = Koha::Checkouts->find({ itemnumber = $itemnumber })->update({ date_due => $due_date }); my $checkout_borrower = $checkout->patron; # send notice to user with recalled item checked out -- 2.11.0