From 6dc5a3296c96acfb686ed0acc523ee5daffbc57b 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 ce38113..40a02ff 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.1.4