Bugzilla – Attachment 146021 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.46 KB, created by
Martin Renvoize (ashimema)
on 2023-02-02 17:04:40 UTC
(
hide
)
Description:
Bug 32772: Make all autocomplete searches 'starts_with'
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-02-02 17:04:40 UTC
Size:
1.46 KB
patch
obsolete
>From c4a8f748b0825162ea562daafee294d05d5a0ec1 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 > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > 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
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