From 922f0890963752c5e350d83bb31c0496fe13ff76 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 14 Aug 2025 13:11:53 +0000 Subject: [PATCH] Bug 39072: Only select exact matches when populating search terms This patch simply reduces our matching pattern to ensure the string is an exact match, rather than partial To test: - Create LOC authorized values of ADULT with description "Adult" and ADULTG with description "Adult - Grab and Go" - Find a record with items and set one item to shelving location "Adult" - Find a second record with items and set one item to shelving location "Adult - Grab and Go" - Create an Item Search for Shelving location and select 'Adult' only - Search and get one result from the record selected above - Click Copy shareable link and paste/go in new tab - See that the results now include both records from above - Click Edit search button and notice that the Shelving location 'Adult - Grab and Go' was added to the selected criteria for the search - Apply patch - Repeat original search for 'Adult' location - Click 'Copy shareable link' - Open in new tab and confirm correct results - Repeat with a search for 'Adult - Grab and Go' and confirm shareable link gets the correct results --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt index e367bfaaeb6..81149316752 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -80,7 +80,7 @@ [% END %] [% FOREACH option IN options %] - [% IF query.param(name).grep(option.value).size %] + [% IF query.param(name).grep('^' _ option.value _ '$').size %] [% ELSE %] -- 2.39.5