From 04bdceb66d415301d3060feb25deb3ec449762e4 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Thu, 29 Mar 2018 18:47:25 +0000 Subject: [PATCH] Bug 20499: Fix the Internal Server Error TEST PLAN --------- See comment #1 Applying the test without the patch: messy. Applyin both patches: smooth. Run koha qa test tools --- C4/Circulation.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 3e711cd..55a60a6 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -668,6 +668,12 @@ sub CanBookBeIssued { my $override_high_holds = $params->{override_high_holds} || 0; my $item = GetItem(undef, $barcode ); + # MANDATORY CHECKS - unless item exists, nothing else matters + unless ( $item->{barcode} ) { + $issuingimpossible{UNKNOWN_BARCODE} = 1; + } + return ( \%issuingimpossible, \%needsconfirmation ) if %issuingimpossible; + my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } ); my $biblio = Koha::Biblios->find( $item->{biblionumber} ); my $biblioitem = $biblio->biblioitem; @@ -675,12 +681,6 @@ sub CanBookBeIssued { my $dbh = C4::Context->dbh; my $patron_unblessed = $patron->unblessed; - # MANDATORY CHECKS - unless item exists, nothing else matters - unless ( $item->{barcode} ) { - $issuingimpossible{UNKNOWN_BARCODE} = 1; - } - return ( \%issuingimpossible, \%needsconfirmation ) if %issuingimpossible; - # # DUE DATE is OK ? -- should already have checked. # -- 2.1.4