From b158ebc1c81ee7bce6eb5b8eca9c395372fff371 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 --- circ/ysearch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circ/ysearch.pl b/circ/ysearch.pl index f008452d74f..dd04aaf9667 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.25.1