@@ -, +, @@ - Delete all issuing rules - Check an item out --- C4/Circulation.pm | 4 ++++ t/db_dependent/Circulation/TooMany.t | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -555,6 +555,10 @@ sub TooMany { } } + if ( not defined( $issuing_rule ) and not defined($branch_borrower_circ_rule->{maxissueqty}) ) { + return { reason => 'NO_RULE_DEFINED', max_allowed => 0 }; + } + # OK, the patron can issue !!! return; } --- a/t/db_dependent/Circulation/TooMany.t +++ a/t/db_dependent/Circulation/TooMany.t @@ -92,15 +92,15 @@ C4::Context->set_userenv($patron->{borrowernumber}, $patron->{userid}, 'usercnum subtest 'no rules exist' => sub { plan tests => 2; - is( + is_deeply( C4::Circulation::TooMany( $patron, $biblio->{biblionumber}, $item ), - undef, - 'CO should be allowed, in any cases' + { reason => 'NO_RULE_DEFINED', max_allowed => 0 }, + 'CO should not be allowed, in any cases' ); - is( + is_deeply( C4::Circulation::TooMany( $patron, $biblio->{biblionumber}, $item, { onsite_checkout => 1 } ), - undef, - 'OSCO should be allowed, in any cases' + { reason => 'NO_RULE_DEFINED', max_allowed => 0 }, + 'OSCO should not be allowed, in any cases' ); }; --