Bug 31313: (QA follow-up) Prefetch checkouts and branches

This prefetches objects we are using in templates to avoid extar DB calls

The branch fetches won't actually be used without the extra patch on 31314 that
adapts home_branch and holding_branch routines to use result objects

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2022-08-15 11:34:59 +00:00 committed by Tomas Cohen Arazi
parent c46b2ab1cd
commit 05be7300ac
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 2 additions and 1 deletions

View File

@ -501,7 +501,8 @@ $items = Koha::Items->search_ordered(
$biblio->host_items->get_column('itemnumber')
]
}
]
],
{ prefetch => [ 'issue', 'homebranch', 'holdingbranch' ] }
)->filter_by_visible_in_opac({ patron => $patron }) unless $specific_item;
my $dat = &GetBiblioData($biblionumber);