From ca27beb7525f6a81abc8d456dc42db5929b863e4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 17 Feb 2022 09:26:02 +0100 Subject: [PATCH] Bug 30055: Force exact match for dropdown MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit For libraries and categories we need to use an exact match. Signed-off-by: Tomas Cohen Arazi Signed-off-by: Séverine Queune Signed-off-by: Martin Renvoize Signed-off-by: Fridolin Somers --- .../prog/en/modules/members/search.tt | 4 ++-- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 24 ++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt index 8f14421f9e..3b79667d9d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt @@ -344,11 +344,11 @@ [% CASE 'branch' %] let library_id = $("#branchcode_filter").val(); patrons_table.find('thead tr:eq(1) th[data-filter="libraries"] select').val(library_id); - table_dt.column([% loop.count - 1 %]).search(library_id); + table_dt.column([% loop.count - 1 %]).search(library_id ? '^'+library_id+'$' : ''); [% CASE 'category' %] let category_id = $("#categorycode_filter").val(); patrons_table.find('thead tr:eq(1) th[data-filter="categories"] select').val(category_id); - table_dt.column([% loop.count - 1 %]).search(category_id); + table_dt.column([% loop.count - 1 %]).search(category_id ? '^'+category_id+'$' : ''); [% END %] [% END %] table_dt.search(""); diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index 077af2ca87..694595be30 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -566,9 +566,14 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { for (var i=0;i