From e5e2bcb2d804035647648006d28fb629e6aa5de0 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sun, 12 May 2019 11:51:28 -0500 Subject: [PATCH] Bug 22891: (bug 21206 follow-up) Fix RenewHold (ILS-DI) From commit 31c29fd31f557306233e6a2936148a5bb10b89a1 Bug 21206: Replace C4::Items::GetItem A missing 'unless' test made RenewHold return prematurely: return $issue; should have been return unless $issue; Test plan: Hit /cgi-bin/koha/ilsdi.pl?service=RenewLoan&patron_id=51&item_id=756 With different situations: 1. Item is checked out to the patron 2. Item is not checked out to the patron 3. Item does not exist 4. Patron does not exist --- C4/ILSDI/Services.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index 8833094109..f6591ebe3b 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -631,10 +631,8 @@ sub RenewLoan { my @renewal = CanBookBeRenewed( $borrowernumber, $itemnumber ); if ( $renewal[0] ) { AddRenewal( $borrowernumber, $itemnumber ); } - return unless $item; # FIXME should be handled - my $issue = $item->checkout; - return $issue; # FIXME should be handled + return unless $issue; # FIXME should be handled # Hashref building my $out; -- 2.11.0