From f5bcf223979f35a487331b484e5f149e6b62a0a7 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 12 Jul 2021 13:58:51 +0000 Subject: [PATCH] Bug 28702: Make buildKohaItemsNamespace take an array If we fetch some of the authorised values and before hand we can reduce the amount of work needed in this routine. We stil require queries for pending holds and transfers, but these are lighter than fetching the items To test: 1 - Perform a search on the OPAC 2 - Add the results to a list 3 - Load the list several times and use developer tools (F12) to view the time to load in the network tab 4 - Repeat a search several times and use developer tools (F12) to view the time to load in the network tab 5 - Record the times noted above 6 - Apply patch 7 - Repeat the search and list view and compare to before the patch 8 - prove -v t/db_dependent/XSLT.t --- C4/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Search.pm b/C4/Search.pm index 2b739c9aa5..afd68b09ee 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1639,7 +1639,7 @@ sub searchResults { }); #Build branchnames hash - my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' })->as_list; + my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' }); my $description = $is_opac ? 'opac_description' : 'lib'; my $shelflocations = -- 2.25.1