[Koha-bugs] [Bug 30004] Prevent TooMany from executing too many SQL queries

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Mar 21 15:28:40 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30004

--- Comment #9 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
(In reply to David Nind from comment #4)
> Is there an easy way to generate 1,000 checkouts for a patron?

The following code will checkout all the items from the DB to the patron with
borrowernumber=51

use Modern::Perl;
use C4::Circulation qw( AddIssue );
use Koha::Items;
use Koha::Patrons;
use t::lib::Mocks;
my $patron = Koha::Patrons->find(51);
t::lib::Mocks::mock_userenv({patron => $patron});
my $items = Koha::Items->search;
my $patron_unblessed = $patron->unblessed;
while ( my $i = $items->next ) {
    AddIssue($patron_unblessed, $i->barcode);
}

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list