From 4dbb5cdf673a212f5c34e9a7e7c91c91baacfa69 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 22 Apr 2025 14:41:24 +0200 Subject: [PATCH] Bug 39473: Use exact search for column filtering with dropdown We need to use an exact search when using the id of an option. Test plan: 0. If not using default KTD data, create an item type with the following settings: Item type: BK Description: Books leave all other values on their defaults 1. Create a new item type with the following settings: Item type: BKA Description: Other type of book leave all other values on their defaults 2. Add or edit items on a bib record so that the record has at least one item of type "Books" and at least one item of type "Another type of book" 3. Go to Normal View for that bib record 4. Click "Show filters" above the item holdings table 5. In the Item type column, filter by "Books" Only "Books" items show in the table Signed-off-by: David Nind Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer (cherry picked from commit ec2fbc0d8129a6b7d9c1f0d1b419af34b3c34c0e) Signed-off-by: Fridolin Somers --- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index 084cb8c82c..0e8799b07f 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -848,7 +848,7 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) { filters_options[i] = filters_options[i](table_dt) } $(filters_options[i]).each(function(){ - let o = $(''.format(this._id, this._str)); + let o = $(''.format(this._id, this._str)); // Compare with lc, or selfreg won't match ^SELFREG$ for instance, see bug 32517 // This is only for category, we might want to apply it only in this case. existing_search = existing_search.toLowerCase()