Bug 24750 - Instructor search does not return results if a comma is included after surname or if first name is included
Summary: Instructor search does not return results if a comma is included after surnam...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Course reserves (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Joe Sikowitz
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-27 21:13 UTC by Joe Sikowitz
Modified: 2020-11-30 21:46 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06, 19.05.11


Attachments
Adds regex to split() for parameters passed to search. (1.12 KB, patch)
2020-04-18 20:13 UTC, Joe Sikowitz
Details | Diff | Splinter Review
Bug 24750: Instructor Search Results (1.17 KB, patch)
2020-04-19 19:34 UTC, David Nind
Details | Diff | Splinter Review
Bug 24750: Instructor Search Results (1.23 KB, patch)
2020-04-27 06:09 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Sikowitz 2020-02-27 21:13:54 UTC
There are two problems with the instructor search when entering a new course in Course Reserves:

1. The autofill box only displays up to 10 names so it is difficult to find an instructor who has a common last name. Is there a better way to handle this?

2. If the user enters a comma between the last name and first name it will often not find the instructor.
Comment 1 Katrin Fischer 2020-04-05 13:18:24 UTC
We could switch it to use the standard patron search used in other modules (for example: adding users to be informed on order lines)
Comment 2 Joe Sikowitz 2020-04-18 20:13:09 UTC
Created attachment 103206 [details] [review]
Adds regex to split() for parameters passed to search.
Comment 3 Joe Sikowitz 2020-04-18 20:28:11 UTC
The patch only addresses the search problem, not the length of the list:

2. If the user enters a comma between the last name and first name it will often not find the instructor.
Comment 4 Katrin Fischer 2020-04-18 20:55:50 UTC
Hi Joe, maybe change the bug title to describe the problem a bit better and split out 1. into a separate bug. It will make it more visible to testers.
Comment 5 Joe Sikowitz 2020-04-18 23:38:07 UTC
Hi Katrin. I changed the title and moved the first part of my original report to bug 25187. Thanks for the help.

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25187
Comment 6 Joe Sikowitz 2020-04-18 23:42:42 UTC
Test plan
1. Go to Course Reserves module.
2. Press New course button.
3. Make active the instructor search box.
4. Start typing the last name of a patron that exists in your database.
5. At the end of the last name type ", " and try to add a first name.
6. The search should fail.
7. Apply the patch.
8. Follow steps 1-5 again.
9. You should now be able to search using the following methods
9a. surname, firstname
9b. firstname surname
Comment 7 David Nind 2020-04-19 19:34:44 UTC
Created attachment 103223 [details] [review]
Bug 24750: Instructor Search Results

Adds regex to the split() of the passed parameters to improve searching.

Test plan
1. Go to Course Reserves module.
2. Press New course button.
3. Make active the instructor search box.
4. Start typing the last name of a patron that exists in your database.
5. At the end of the last name type ", " and try to add a first name.
6. The search should fail.
7. Apply the patch.
8. Follow steps 1-5 again.
9. You should now be able to search using the following methods
9a. surname, firstname
9b. firstname surname

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 Katrin Fischer 2020-04-25 23:29:26 UTC
Hi Joe, when you plan to write a patch, please make sure you assign the bug to yourself (Assignee in the form). Thx!
Comment 9 Katrin Fischer 2020-04-27 06:09:37 UTC
Created attachment 103731 [details] [review]
Bug 24750: Instructor Search Results

Adds regex to the split() of the passed parameters to improve searching.

Test plan
1. Go to Course Reserves module.
2. Press New course button.
3. Make active the instructor search box.
4. Start typing the last name of a patron that exists in your database.
5. At the end of the last name type ", " and try to add a first name.
6. The search should fail.
7. Apply the patch.
8. Follow steps 1-5 again.
9. You should now be able to search using the following methods
9a. surname, firstname
9b. firstname surname

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2020-04-27 06:10:30 UTC
Welcome, Joe :)
Comment 11 Martin Renvoize 2020-04-27 10:45:14 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 12 Joy Nelson 2020-05-08 21:34:00 UTC
Backported to 19.11.x for 19.11.06
Comment 13 Lucas Gass 2020-05-14 21:17:26 UTC
backported to 19.05.x for 19.05.11