From 6bc13f9c3419445453feaa213bec32ac7692234e Mon Sep 17 00:00:00 2001 From: Didier Gautheron Date: Thu, 14 Mar 2024 14:51:35 +0100 Subject: [PATCH] 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 --- C4/ILSDI/Services.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index ee776423a9..016b2ac06e 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -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}; } } -- 2.39.2