From 5899badc3eb4f21dad44654c25fa1b9afc748243 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 11 May 2009 16:10:37 -0500 Subject: [PATCH] fix to CanBookBeIssued() Bail out if item does not exist - otherwise subsequent checks can fail for lack of an item branchcode. Signed-off-by: Galen Charlton --- C4/Circulation.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 1c8052b8f5..e6389eed94 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -669,6 +669,12 @@ sub CanBookBeIssued { $item->{'itemtype'}=$item->{'itype'}; my $dbh = C4::Context->dbh; + # 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. # @@ -748,10 +754,6 @@ sub CanBookBeIssued { # # ITEM CHECKING # - unless ( $item->{barcode} ) { - $issuingimpossible{UNKNOWN_BARCODE} = 1; - } - if ( $item->{'notforloan'} && $item->{'notforloan'} > 0 ) { -- 2.39.5