The search we currently form is: "extended_attributes.value": { "like": "%" + pattern + (search_type == "contain" ? "%" : "" )}, Which defaults to an 'ends with' search
Created attachment 152485 [details] [review] Bug 34067: Correct patron attributes 'starts with' search To test: 1 - Add a new searchable patron attribute type: Koha->Adminsitration->Patron attribute types 2 - Edit a patron and add a value 'alphabeta' for the attribute 3 - Go to 'Patrons', cick the settings icon in search and confirm search type is 'starts with' 4 - Type 'alpha' in the search bar, enter 5 - No patron found, wrong 6 - Type 'beta' in search bar, enter 7 - Patron found, wrong 8 - Apply patch 9 - Search for 'alpha', it finds the patron! 10 - Search for 'beta', patron not found 11 - Change search type to 'contains' 12 - Search for 'beta' 13 - Patron found!
Created attachment 152491 [details] [review] Bug 34067: Correct patron attributes 'starts with' search To test: 1 - Add a new searchable patron attribute type: Koha->Adminsitration->Patron attribute types 2 - Edit a patron and add a value 'alphabeta' for the attribute 3 - Go to 'Patrons', cick the settings icon in search and confirm search type is 'starts with' 4 - Type 'alpha' in the search bar, enter 5 - No patron found, wrong 6 - Type 'beta' in search bar, enter 7 - Patron found, wrong 8 - Apply patch 9 - Search for 'alpha', it finds the patron! 10 - Search for 'beta', patron not found 11 - Change search type to 'contains' 12 - Search for 'beta' 13 - Patron found! Signed-off-by: Sam Lau <samalau@gmail.com>
This is solved in master by 34092 - that should either be backported, or we move this patch to a stables only queue and fix it here
I believe the plan is to push bug 34092 to 22.11.x, but we're waiting for it for first land on 23.05.x.
(In reply to Pedro Amorim from comment #4) > I believe the plan is to push bug 34092 to 22.11.x, but we're waiting for it > for first land on 23.05.x. I'm going to close this as a duplicate then, thanks for the fix :-) *** This bug has been marked as a duplicate of bug 34092 ***
(In reply to Pedro Amorim from comment #4) > I believe the plan is to push bug 34092 to 22.11.x, but we're waiting for it > for first land on 23.05.x. I personally think we should extract the patron autocomplete (and or patron search) from staff-global and put it back into a specific js file.