We are running Koha 22.11.03 in Spanish, and today I have found a problem if I search for a patron in the staff interface with the “checkout” search (“préstamo”). In Spanish speaking countries, people usually have 2 surnames. When I create a new user, I write both surnames in the “surname” field and both given names in the “First name” field. If I enter the name or parts of it in the “checkout” search, without hitting Enter, I get a list of results where I can choose from. It used to be possible in previous versions to search for patrons using the first name and the second surname. Today I found that this is not possible anymore. For example, if there is a patron with the name “Carla María Ramírez Hernández”, I find her if I search with “Carla Ramírez”, but not if I search with “Carla Hernández”. It doesn´t work either if I search with the second given name and first surname (“María Ramírez”).
Regression caused by bug 32772.
(In reply to Jonathan Druart from comment #1) > Regression caused by bug 32772. The previous behvaiour is still possible, it now requires entering a wildcard before your term, e.g.: %María %Ramírez It's a trade off, some libraries were getting too many results, now some are getting too few. We went towards a default of 'starts with' because it allowed wildcard use to replicate previous behvaiour I would support a switch (syspref) to allow choosing 'starts with' or 'contains' as the default for patron searching.
> I would support a switch (syspref) to allow choosing 'starts with' or 'contains' as the default for patron searching. I would like to support this too. In our library we are dealing very often with little children who don't know all of their first and last names, which makes the search very slow when the autocomplete doesn't work the way it used to. Thank you.
Created attachment 148018 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod Added a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. Test Plan: 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. Search for the patron using their first name and first surname. Confirm that a record is found. 3. Search for the patron using their first name and second surname. Confirm that no record is found. 4. Search for the patron using their middle name and first surname. Confirm that a record is found. 5. Search for the patron using their middle name and second surname. Confirm that no record is found. 6. Apply the patch. 7. Under Administration > Global System Preferences > search for “PatronAutocompleteSearchMethod” 8. Choose “Contains” instead of “Starts with” for the system preference. 9. Repeat steps 2-4. The patron record should appear for all search methods. 10. Sign off!
Caught an error. I will work on updating the patch.
Created attachment 148027 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod Added a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. Test Plan: 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. Search for the patron using their first name and first surname. Confirm that a record is found. 3. Search for the patron using their first name and second surname. Confirm that no record is found. 4. Search for the patron using their middle name and first surname. Confirm that a record is found. 5. Search for the patron using their middle name and second surname. Confirm that no record is found. 6. Apply the patch. 7. Under Administration > Global System Preferences > search for “PatronAutocompleteSearchMethod” 8. Choose “Contains” instead of “Starts with” for the system preference. 9. Repeat steps 2-4. The patron record should appear for all search methods. 10. Sign off!
Created attachment 148095 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod Added a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. Test Plan: 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. Search for the patron using their first name and first surname. Confirm that a record is found. 3. Search for the patron using their first name and second surname. Confirm that no record is found. 4. Search for the patron using their middle name and first surname. Confirm that a record is found. 5. Search for the patron using their middle name and second surname. Confirm that no record is found. 6. Apply the patch. 7. Under Administration > Global System Preferences > search for “PatronAutocompleteSearchMethod” 8. Choose “Contains” instead of “Starts with” for the system preference. 9. Repeat steps 2-4. The patron record should appear for all search methods. 10. Sign off!
Created attachment 148131 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod Added a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. Test Plan: 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. Search for the patron using their first name and first surname. Confirm that a record is found. 3. Search for the patron using their first name and second surname. Confirm that no record is found. 4. Search for the patron using their middle name and first surname. Confirm that a record is found. 5. Search for the patron using their middle name and second surname. Confirm that no record is found. 6. Apply the patch. 7. Under Administration > Global System Preferences > search for “PatronAutocompleteSearchMethod” 8. Choose “Contains” instead of “Starts with” for the system preference. 9. Repeat steps 2-4. The patron record should appear for all search methods. 10. Sign off!
Hi, Laura. I see the ticket still 'ASSIGNED', is it ready for testers to look at it?
Created attachment 148138 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod Added a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. Test Plan: 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. Search for the patron using their first name and first surname. Confirm that a record is found. 3. Search for the patron using their first name and second surname. Confirm that no record is found. 4. Search for the patron using their middle name and first surname. Confirm that a record is found. 5. Search for the patron using their middle name and second surname. Confirm that no record is found. 6. Apply the patch. 7. Under Administration > Global System Preferences > search for “PatronAutocompleteSearchMethod” 8. Choose “Contains” instead of “Starts with” for the system preference. 9. Repeat steps 2-4. The patron record should appear for all search methods. 10. Sign off!
(In reply to Tomás Cohen Arazi from comment #9) > Hi, Laura. I see the ticket still 'ASSIGNED', is it ready for testers to > look at it? Hi Tomas. Not quite yet! I haven't switched it to Needs Signoff because I'm still working on it.
Created attachment 148278 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod Added a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. Test Plan: 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. Search for the patron using their first name and first surname. Confirm that a record is found. 3. Search for the patron using their first name and second surname. Confirm that no record is found. 4. Search for the patron using their middle name and first surname. Confirm that a record is found. 5. Search for the patron using their middle name and second surname. Confirm that no record is found. 6. Apply the patch. 7. Under Administration > Global System Preferences > search for “PatronAutocompleteSearchMethod” 8. Choose “Contains” instead of “Starts with” for the system preference. 9. Repeat steps 2-4. The patron record should appear for all search methods. 10. Sign off!
Created attachment 148279 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod Added a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. Test Plan: 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. Search for the patron using their first name and first surname. Confirm that a record is found. 3. Search for the patron using their first name and second surname. Confirm that no record is found. 4. Search for the patron using their middle name and first surname. Confirm that a record is found. 5. Search for the patron using their middle name and second surname. Confirm that no record is found. 6. Apply the patch. 7. Under Administration > Global System Preferences > search for “PatronAutocompleteSearchMethod” 8. Choose “Contains” instead of “Starts with” for the system preference. 9. Repeat steps 2-4. The patron record should appear for all search methods. 10. Sign off!
Created attachment 148280 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod Added a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. Test Plan: 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. Search for the patron using their first name and first surname. Confirm that a record is found. 3. Search for the patron using their first name and second surname. Confirm that no record is found. 4. Search for the patron using their middle name and first surname. Confirm that a record is found. 5. Search for the patron using their middle name and second surname. Confirm that no record is found. 6. Apply the patch. 7. Under Administration > Global System Preferences > search for “PatronAutocompleteSearchMethod” 8. Choose “Contains” instead of “Starts with” for the system preference. 9. Repeat steps 2-4. The patron record should appear for all search methods. 10. Sign off!
Created attachment 148282 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod Added a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. Test Plan: 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. Search for the patron using their first name and first surname. Confirm that a record is found. 3. Search for the patron using their first name and second surname. Confirm that no record is found. 4. Search for the patron using their middle name and first surname. Confirm that a record is found. 5. Search for the patron using their middle name and second surname. Confirm that no record is found. 6. Apply the patch. 7. Under Administration > Global System Preferences > search for “PatronAutocompleteSearchMethod” 8. Choose “Contains” instead of “Starts with” for the system preference. 9. Repeat steps 2-4. The patron record should appear for all search methods. 10. Sign off!
Created attachment 148336 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod Added a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. Test Plan: 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. Search for the patron using their first name and first surname. Confirm that a record is found. 3. Search for the patron using their first name and second surname. Confirm that no record is found. 4. Search for the patron using their middle name and first surname. Confirm that a record is found. 5. Search for the patron using their middle name and second surname. Confirm that no record is found. 6. Apply the patch. 7. Under Administration > Global System Preferences > search for “PatronAutocompleteSearchMethod” 8. Choose “Contains” instead of “Starts with” for the system preference. 9. Repeat steps 2-4. The patron record should appear for all search methods. 10. Sign off!
Created attachment 148383 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod Added a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. Test Plan: 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. Search for the patron using their first name and first surname. Confirm that a record is found. 3. Search for the patron using their first name and second surname. Confirm that no record is found. 4. Search for the patron using their middle name and first surname. Confirm that a record is found. 5. Search for the patron using their middle name and second surname. Confirm that no record is found. 6. Apply the patch. 7. Under Administration > Global System Preferences > search for “PatronAutocompleteSearchMethod” 8. Choose “Contains” instead of “Starts with” for the system preference. 9. Repeat steps 2-4. The patron record should appear for all search methods. 10. Sign off!
Created attachment 148384 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod Added a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. Test Plan: 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. Search for the patron using their first name and first surname. Confirm that a record is found. 3. Search for the patron using their first name and second surname. Confirm that no record is found. 4. Search for the patron using their middle name and first surname. Confirm that a record is found. 5. Search for the patron using their middle name and second surname. Confirm that no record is found. 6. Apply the patch. 7. Under Administration > Global System Preferences > search for “PatronAutocompleteSearchMethod” 8. Choose “Contains” instead of “Starts with” for the system preference. 9. Repeat steps 2-4. The patron record should appear for all search methods. 10. Sign off! Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 148443 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod *Made a few minor syntax changes* Added a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. New Test Plan: 0. Ensure system preference PatronAutoComplete is set to Try 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. In patron or checkout search, enter their first name and first surname without submitting. 3. Confirm that a record is found in the autocomplete results 4. In patron or checkout search, enter their first name and second surname without submitting. 5. Confirm that no record is found. 6. Enter their middle name and first surname. Confirm that no record is found. 7. Enter their middle name and second surname. Confirm that no record is found. 8. Apply the patch, update database 9. Under Administration > Global System Preferences > search for "PatronAutocompleteSearchMethod" 10. Choose "Contains" instead of "Starts with" for the system preference. 11. Repeat steps 2-4. The patron record should appear for all search methods. 12. Sign off!
Created attachment 148445 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod *Made a few minor syntax changes* Added a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. New Test Plan: 0. Ensure system preference PatronAutoComplete is set to Try 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. In patron or checkout search, enter their first name and first surname without submitting. 3. Confirm that a record is found in the autocomplete results 4. In patron or checkout search, enter their first name and second surname without submitting. 5. Confirm that no record is found. 6. Enter their middle name and first surname. Confirm that no record is found. 7. Enter their middle name and second surname. Confirm that no record is found. 8. Apply the patch, update database 9. Under Administration > Global System Preferences > search for "PatronAutocompleteSearchMethod" 10. Choose "Contains" instead of "Starts with" for the system preference. 11. Repeat steps 2-4. The patron record should appear for all search methods. 12. Sign off!
Created attachment 148467 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod This patch adds a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. New Test Plan: 0. Ensure system preference PatronAutoComplete is set to Try 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. In patron or checkout search, enter their first name and first surname without submitting. 3. Confirm that a record is found in the autocomplete results 4. In patron or checkout search, enter their first name and second surname without submitting. 5. Confirm that no record is found. 6. Enter their middle name and first surname. Confirm that no record is found. 7. Enter their middle name and second surname. Confirm that no record is found. 8. Apply the patch, update database 9. Under Administration > Global System Preferences > search for "PatronAutocompleteSearchMethod" 10. Choose "Contains" instead of "Starts with" for the system preference, reload your search page 11. Repeat steps 2-4. The patron record should appear for all search methods. 12. Sign off!
Created attachment 148481 [details] [review] Bug 33117: Added new syspref Patronautocompletesesarchmethod This patch adds a new system preference called "PatronAutoCompleteSearchMethod" which allows staff to choose between "Starts with" or "Contains" when searching for patrons. The "Contains" option should be useful when searching for patrons that have multiple surnames or when searching using a patron's middle name. New Test Plan: 0. Ensure system preference PatronAutoComplete is set to Try 1. Create a patron that has a first name, middle name and two surnames. (i.e. Adela Maria, Hernandez Acosta). 2. In patron or checkout search, enter their first name and first surname without submitting. 3. Confirm that a record is found in the autocomplete results 4. In patron or checkout search, enter their first name and second surname without submitting. 5. Confirm that no record is found. 6. Enter their middle name and first surname. Confirm that no record is found. 7. Enter their middle name and second surname. Confirm that no record is found. 8. Apply the patch, update database 9. Under Administration > Global System Preferences > search for "PatronAutocompleteSearchMethod" 10. Choose "Contains" instead of "Starts with" for the system preference, reload your search page 11. Repeat steps 2-4. The patron record should appear for all search methods. 12. Sign off! Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
I also confirmed that the searches in steps 5 and 6 both work with PatronAutocompleteSearchMethod set to Contains and then leaving PatronAutocompleteSearchMethod set to Starts With maintains all of the pre-patch behavior.
Why are you passing the syspref value to the patron_autocomplete JS function, instead of retrieving the value from there? I think you should create a global JS variable (in doc-head-close.inc for instance), then use it when you need it in patron_autocomplete. Also you are using TT syntax in 2 js files (tags-review.js and viewlog.js), it won't work.
(In reply to Jonathan Druart from comment #24) > Why are you passing the syspref value to the patron_autocomplete JS > function, instead of retrieving the value from there? > > I think you should create a global JS variable (in doc-head-close.inc for > instance), then use it when you need it in patron_autocomplete. > > Also you are using TT syntax in 2 js files (tags-review.js and viewlog.js), > it won't work. Thanks for the feedback. I'll look into how to adjust this.