From dc88e53e26c54c1b47c30d0c084ba0915843690f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 16 Aug 2021 10:49:48 +0200 Subject: [PATCH] Bug 10902: Use prefetch and dbic rs Signed-off-by: Jonathan Druart --- circ/ysearch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circ/ysearch.pl b/circ/ysearch.pl index f008452d74..dd04aaf966 100755 --- a/circ/ysearch.pl +++ b/circ/ysearch.pl @@ -75,12 +75,12 @@ my $borrowers_rs = Koha::Patrons->search_limited( page => 1, rows => 10, order_by => [ 'surname', 'firstname' ], + prefetch => 'branchcode', }, ); my @borrowers; while ( my $b = $borrowers_rs->next ) { - my $library = Koha::Libraries->find( $b->branchcode ); push @borrowers, { borrowernumber => $b->borrowernumber, surname => $b->surname // '', @@ -93,7 +93,7 @@ while ( my $b = $borrowers_rs->next ) { zipcode => $b->zipcode // '', country => $b->country // '', branchcode => $b->branchcode // '', - branchname => $library->branchname // '', + branchname => $b->library->branchname // '', }; } -- 2.39.5