@@ -, +, @@ t/db_dependent/Circulation/TooMany.t fails t/db_dependent/Circulation/TooMany.t succeeds --- C4/Circulation.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -543,10 +543,11 @@ sub TooMany { $checkouts = $patron->checkouts->search( { 'me.branchcode' => $branch} ); } elsif (C4::Context->preference('CircControl') eq 'PatronLibrary') { - ; # if branch is the patron's home branch, then count all loans by patron + $checkouts = $patron->checkouts; # if branch is the patron's home branch, then count all loans by patron } else { $checkouts = $patron->checkouts->search( - { 'item.homebranch' => $branch} ); + { 'item.homebranch' => $branch}, + { prefetch => 'item' } ); } my $checkout_count = $checkouts->count; --