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.
Created attachment 150781 [details] [review] Bug 33117: New System Preference PatronAutoCompleteSearchMethod WIP - NOT READY FOR TESTING
Created attachment 150896 [details] [review] Bug 33117: New System Preference PatronAutoCompleteSearchMethod WIP - Not ready for testing
Created attachment 150897 [details] [review] Bug 33117: New System Preference PatronAutoCompleteSearchMethod WIP - Fixing up syntax errors - NOT READY FOR TESTING
Created attachment 150898 [details] [review] Bug 33117: New System Preference PatronAutoCompleteSearchMethod Still a WIP -
Created attachment 151090 [details] [review] Bug 33117: New System Preference PatronAutoCompleteSearchMethod Still working on this --
Created attachment 151091 [details] [review] Bug 33117: Adding new system preference for patron searching
Created attachment 151302 [details] [review] Bug 33117: Adding new system preference for patron searching
Created attachment 151314 [details] [review] Bug 33117: Adding new system preference for patron searching
Created attachment 151317 [details] [review] Bug 33117: Adding new system preference for patron searching
Laura, let me know if you need help here. I would suggest to use strings as codes for the syspref, 'start_with' and 'contains', instead of a boolean value.
* use strings instead of codes
Created attachment 151769 [details] [review] Bug 33117: Adding new PatronAutoCompleteSearchMethod system preference 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 151771 [details] [review] Bug 33117: New system preference - PatronAutoCompleteSearchMethod 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!
Hi Laura, this needs some more work: 1) The database update doesn't work correctly: FAIL installer/data/mysql/atomicupdate/bug_33117.pl FAIL valid syntax error (Might be a runaway multi-line {} string starting on line 10) syntax error Missing right curly or square bracket installer/data/mysql/atomicupdate/bug_33117.pl had compilation errors. DEV atomic update /kohadevbox/koha/installer/data/mysql/atomicupdate/bug_33117.pl [15:19:11] ERROR - {UNKNOWN}: Can't use an undefined value as a subroutine reference at /kohadevbox/koha/C4/Installer.pm line 741. at /kohadevbox/koha/C4/Installer.pm line 743 2) There are some issues with the 'metadata' of the patches: * Author 'John Doe' seems invalid * Author 'John Doe' seems invalid * Email's author 'you@example.com' seems invalid * Email's author 'you@example.com' seems invalid Can you please have a look?
Created attachment 151825 [details] [review] Bug 33117: Adding new PatronAutoCompleteSearchMethod system preference Same test plan as above
Created attachment 151845 [details] [review] Bug 33117: Adding new PatronAutoCompleteSearchMethod system preference
(In reply to Laura Escamilla from comment #41) > Created attachment 151845 [details] [review] [review] > Bug 33117: Adding new PatronAutoCompleteSearchMethod system preference Need to fix a few more things. Not ready for testing again.
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!
This is mostly working. Here is what I found in my testing: When searching via 'Check out' from the searchbar all combinations of names displayed in the autocomplete results. After typing in a name and hitting 'enter' all four combinations opened up the patron record. When searching via 'Patrons' from the searchbar all combinations of names displayed in the autocomplete results. However, only the search containing the combination of the first name and first surname brought up the patron. The other three combinations did not find the patron record. When searching for patrons via the patron form on the left side on members-home.pl all four combinations brought up the patron record. So something is still preventing actually bringing up the patron record for the following combinations when using the 'Search patrons' option from the searchbar: --first name, second surname --middle name, first surname --middle name, second surname
Because of the work done on bug 33117, we currently have a situation where the default search in the header search bar is "Starts with" but the default search in the search box on the left hand side of the page on members-home.pl is "Contains." This is very confusing for library staff. Whatever happens next with this patch, this new system preference should make the default search type match in the header search bar and on members-home.pl
Excuse me, I meant to say because of the work done on bug 32772. That's the bug that's caused the search type to be different in its two different appearances.
Created attachment 152549 [details] [review] Bug 33117: Adding new PatronAutoCompleteSearchMethod system preference 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> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 152552 [details] [review] Bug 33117: Adding new PatronAutoCompleteSearchMethod system preference 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> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
I fixed the authorship, tidied the DB update and then tested. For me, the test plan is all passing and I couldn't replicate the issues raised by Barbara. I think we should come back to the consistency between interfaces in another bug.. mostly because I think this is an important fix and when I tried to follow-up to make the various interfaces consistent I found there was more than I expected.. (hint, just passing searchtype from the various controllers isn't enough.. the forms don't respect the param for some reason) So.. with that in mind, I'm happy to PQA this patch and open a new bug to work on the consistency work.
My only caveat here is the preference name.. I'd be tempted to drop the 'AutoComplete' part and have it as just `DefaultPatronSearchMethod` and sit it next to `DefaultPatronSearchFields` I'll do a follow-up for that now.
Created attachment 152554 [details] [review] Bug 33117: (follow-up) Rename preference As it's been requested that we keep the search defaults consistent, I think this preference is better names DefaultPatronSearchMethod and appear next to DefaultPatronSearchFields. This patch makes that change, though actually applying it to the other search area's (outside of autocomplete) has been left for another bug. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 152555 [details] [review] Bug 33117: (follow-up) Rename preference As it's been requested that we keep the search defaults consistent, I think this preference is better names DefaultPatronSearchMethod and appear next to DefaultPatronSearchFields. This patch makes that change, though actually applying it to the other search area's (outside of autocomplete) has been left for another bug. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 152556 [details] [review] Bug 33117: (follow-up) Rename preference As it's been requested that we keep the search defaults consistent, I think this preference is better names DefaultPatronSearchMethod and appear next to DefaultPatronSearchFields. This patch makes that change, though actually applying it to the other search area's (outside of autocomplete) has been left for another bug. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 152562 [details] [review] Bug 33117: (follow-up) Rename preference As it's been requested that we keep the search defaults consistent, I think this preference is better names DefaultPatronSearchMethod and appear next to DefaultPatronSearchFields. This patch makes that change, though actually applying it to the other search area's (outside of autocomplete) has been left for another bug. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 152563 [details] [review] Bug 33117: Adding new PatronAutoCompleteSearchMethod system preference 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> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 152564 [details] [review] Bug 33117: (follow-up) Rename preference As it's been requested that we keep the search defaults consistent, I think this preference is better names DefaultPatronSearchMethod and appear next to DefaultPatronSearchFields. This patch makes that change, though actually applying it to the other search area's (outside of autocomplete) has been left for another bug. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 152565 [details] [review] Bug 33117: (follow-up) Make preference options match existing codebase We pass a searchtype around sometimes, this is either 'start_with' or 'contain'.. we should match the preference options (i.e. drop the 's') Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Pushed to master for 23.11. Nice work everyone, thanks!
Thanks for all the hard work! Pushed to 23.05.x for the next release
Nice work everyone! Pushed to 22.11.x for next release
Note: non-idempotent atomic update. INSERT INTO systempreferences -> INSERT IGNORE INTO systempreferences
Indeed, fix needed in installer/data/mysql/db_revs/230600006.pl
Created attachment 154309 [details] [review] Bug 33117: Make dbrev idempotent QA didn't spot the issue, nor I. So fixing now. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Follow-up pushed to master. @RMaints please port the last patch.
Done for 23.05.x
I wonder if bug https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34580 is related to changes introduced here.
Arg again ! I propose a patch in Bug 34580
(In reply to Manos PETRIDIS from comment #67) > I wonder if bug > https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34580 is related > to changes introduced here. Indeed. This is fixed in 23.05.03 with patch "Bug 33117: Make dbrev idempotent" https://git.koha-community.org/Koha-community/Koha/commits/branch/23.05.x/search?q=33117
Added test to QA script (we had it for updatedatabase.pl) https://gitlab.com/koha-community/qa-test-tools/-/issues/74!
Just a note that for people updating from before 22.11 (we updated from 22.05 to 23.05), the new syspref default (starts with) changes the historic behaviour (contains). The default keeps the "new" behaviour introduced by the regression. Something to keep in mind when updating. We had to change the syspref in all our client installations after several clients reported having problems with the search.
*** Bug 36318 has been marked as a duplicate of this bug. ***
Please put the status to Needs documenting when there is a new system preference (or if a system preference was removed). Thanks! :)