[Koha-patches] [PATCH] fix to CanBookBeIssued()
Galen Charlton
galen.charlton at liblime.com
Mon May 11 23:11:24 CEST 2009
Bail out if item does not exist - otherwise
subsequent checks can fail for lack of an
item branchcode.
---
C4/Circulation.pm | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index 1c8052b..e6389ee 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 )
{
--
1.5.6.5
More information about the Koha-patches
mailing list