Bugzilla – Attachment 145905 Details for
Bug 32772
Patron autocomplete should not use contains on all fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32772: Make all autocomplete searches 'starts_with'
Bug-32772-Make-all-autocomplete-searches-startswit.patch (text/plain), 1.40 KB, created by
Nick Clemens
on 2023-01-31 20:17:22 UTC
(
hide
)
Description:
Bug 32772: Make all autocomplete searches 'starts_with'
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2023-01-31 20:17:22 UTC
Size:
1.40 KB
patch
obsolete
>From 74f0fa06a9333aefba2c4dea16050ece9677c57e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >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 >--- > 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 39d55e88f8..f4620896ce 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.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32772
:
145905
|
145914
|
146021