From 5f081ea7eb85684cb5f069a1e5be26dd03936aa6 Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Mon, 1 Dec 2025 15:57:00 +0000 Subject: [PATCH] Bug 41341: [WIP] Reestablish exact matching on library/items Test plan 1 - Create a library with code "M" and an itemtype with code "B". 2 - Go on /cgi-bin/koha/catalogue/detail.pl?biblionumber=233 (a biblio with items from midway (MPL) and books (BK) 3 - Filter using library and itemtype created in 1 -> you will get some new filters 4 - Apply patch 5 - Test 3 again -> you should have no result anymore. 6 - Check that filters still work on libraries/items --- .../includes/html_helpers/tables/items/catalogue_detail.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index 003a1d37803..522ae9cb6b3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -236,8 +236,8 @@ [% END %] var coded_values = { - library: new Map(all_libraries.map( l => [l.branchname, l.branchcode] )), - item_type: new Map(all_item_types.map( i => [i.translated_description, i.itemtype] )), + library: new Map(all_libraries.map( l => [l.branchname, "^" + l.branchcode + "$"] )), + item_type: new Map(all_item_types.map( i => [i.translated_description, "^" + i.itemtype + "$"] )), collection_code: new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.ccode' })) | $raw %].map( av => [av.lib, av.authorised_value])), location: new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.location' })) | $raw %].map( av => [av.lib, av.authorised_value])), }; -- 2.43.0