From f347754d522d1e2e7a23df248ff8674f64becd5d Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Fri, 1 Jan 2016 00:30:40 -0500 Subject: [PATCH] Bug 9021: Flag issues Check in and check out were failing for me. Specificly, the $borrower->{flags}->{...} was not accessible as a hash, so I put a hash ref check around the code that would fail. TEST PLAN --------- 1) Attempt a checkout -- blows up with "1" not being allowed as a hash ref. 2) Apply patch 3) Attempt same checkout again -- success 4) prove -v t/db_dependent/Circulation_dateexpiry.t -- this triggers CanBookBeIssued -- this should succeed 5) prove -v t/db_dependent/rollingloans.t -- mine skipped the tests, but if configured, it should also trigger and succeed. 6) run koha qa test tools Signed-off-by: Mark Tompsett Signed-off-by: Kyle M Hall Signed-off-by: Mark Tompsett Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- C4/Circulation.pm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index ae53366c7e..f30b3856fa 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -812,14 +812,16 @@ sub CanBookBeIssued { ModDateLastSeen( $item->{'itemnumber'} ); return( { STATS => 1 }, {}); } - if ( $borrower->{flags}->{GNA} ) { - $issuingimpossible{GNA} = 1; - } - if ( $borrower->{flags}->{'LOST'} ) { - $issuingimpossible{CARD_LOST} = 1; - } - if ( $borrower->{flags}->{'DBARRED'} ) { - $issuingimpossible{DEBARRED} = 1; + if ( ref $borrower->{flags} ) { + if ( $borrower->{flags}->{GNA} ) { + $issuingimpossible{GNA} = 1; + } + if ( $borrower->{flags}->{'LOST'} ) { + $issuingimpossible{CARD_LOST} = 1; + } + if ( $borrower->{flags}->{'DBARRED'} ) { + $issuingimpossible{DEBARRED} = 1; + } } if ( !defined $borrower->{dateexpiry} || $borrower->{'dateexpiry'} eq '0000-00-00') { $issuingimpossible{EXPIRED} = 1; -- 2.39.5