From c4a8f748b0825162ea562daafee294d05d5a0ec1 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 31 Jan 2023 20:15:09 +0000 Subject: [PATCH] Bug 32772: Make all autocomplete searches 'starts_with' To test: 1 - Add patrons with surname Fitzwilliams and Williams 2 - Enable 'PatronAutocomplete' syspref 3 - In checkout box type 'Will' 4 - You see fitwilliams first 5 - Apply patch 6 - Type 'Will' 7 - Autocomplete does not suggest Fitzwilliam, only Williams 8 - Type '%will' 9 - Fitzwilliams is suggested Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js b/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js index 39d55e88f81..f4620896ced 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js +++ b/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js @@ -22,7 +22,7 @@ function patron_autocomplete(node, options) { let subquery_or = []; defaultPatronSearchFields.split(',').forEach(function(field,i){ subquery_or.push( - {["me."+field]: {'like': '%' + pattern + '%'}} + {["me."+field]: {'like': pattern + '%'}} ); }); subquery_and.push(subquery_or); -- 2.39.1