From 28098b5bdab1e6edc03c90324e755c23a6174114 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 Signed-off-by: Henri-Damien LAURENT --- C4/Circulation.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index b63d11d6ad..c91a15c89a 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -648,6 +648,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. # -- 2.39.5