Bug 19198: do not autovivify
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 6 Oct 2017 14:49:38 +0000 (11:49 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 6 Oct 2017 15:00:19 +0000 (12:00 -0300)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Circulation.pm

index 6ba87a2..b915b34 100644 (file)
@@ -893,7 +893,7 @@ sub CanBookBeIssued {
       and $issue->borrowernumber == $borrower->{'borrowernumber'} ? 1 : 0 );
     my $toomany = TooMany( $borrower, $item->{biblionumber}, $item, { onsite_checkout => $onsite_checkout, switch_onsite_checkout => $switch_onsite_checkout, } );
     # if TooMany max_allowed returns 0 the user doesn't have permission to check out this book
-    if ( $toomany && !$needsconfirmation{RENEW_ISSUE} ) {
+    if ( $toomany && not exists $needsconfirmation{RENEW_ISSUE} ) {
         if ( $toomany->{max_allowed} == 0 ) {
             $needsconfirmation{PATRON_CANT} = 1;
         }