Bug 36315: ILSDI GetRecords use AuthorisedValues cache for items.location

Speedup GetRecords by using Koha cache for items.location authorised value.

Test plan
1) Enable ILS-DI http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ILS-DI
2) Download a record   http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetRecords&id=1
3) Note location_description
4) Apply patch
5) Re download the same record
6) Verify location_description are the same

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Didier Gautheron 2024-03-14 14:51:35 +01:00 committed by Katrin Fischer
parent 7cea5b6f34
commit e4681dcc44
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 2 additions and 2 deletions

View File

@ -254,9 +254,9 @@ sub GetRecords {
$item{'holdingbranchname'} = $holding_library ? $holding_library->branchname : '';
if ($item->location) {
my $authorised_value = Koha::AuthorisedValues->find_by_koha_field({ kohafield => 'items.location', authorised_value => $item->location });
my $authorised_value = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => '', kohafield => 'items.location', authorised_value => $item->location });
if ($authorised_value) {
$item{location_description} = $authorised_value->opac_description;
$item{location_description} = $authorised_value->{opac_description};
}
}