From 8b89305d7c524e1017979c99d6540248ea5aa923 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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/opac/opac-recall.pl b/opac/opac-recall.pl index 0f8e39e..24f9f1b 100755 --- a/opac/opac-recall.pl +++ b/opac/opac-recall.pl @@ -87,8 +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