Bug 16316 - Make it possible to limit patron search to surname
Summary: Make it possible to limit patron search to surname
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Magnus Enger
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-21 12:36 UTC by Magnus Enger
Modified: 2016-12-05 21:27 UTC (History)
5 users (show)

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


Attachments
Bug 16316 - Limit patron search to surname (3.25 KB, patch)
2016-04-21 13:04 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 16316 - Limit patron search to surname (3.30 KB, patch)
2016-04-21 17:57 UTC, Magnus Enger
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16316 - Limit patron search to surname (3.40 KB, patch)
2016-04-21 18:09 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16316 - QA FOLLOWUP - Add tests (4.65 KB, patch)
2016-04-26 10:51 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 16316 - Limit patron search to surname (3.42 KB, patch)
2016-04-26 18:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16316 - QA FOLLOWUP - Add tests (4.72 KB, patch)
2016-04-26 18:11 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2016-04-21 12:36:49 UTC
I have a customer that wants to be able to limit a patron search to just searching for surnames.
Comment 1 Magnus Enger 2016-04-21 13:04:13 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2016-04-21 13:37:13 UTC
> - Set "Search fields" = Surname and search for "doe".
>   Neither "Doe John" nor "John Doe" should show up.

Is this part of the test plan correct? Why should neither show up?
Comment 3 Magnus Enger 2016-04-21 17:57:46 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2016-04-21 18:09:46 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2016-04-23 07:12:42 UTC
Magnus, please provide test coverage for the change in C4::Utils::DataTables::Members::search. It would be quite easy to do, this subroutine is already well covered.
Comment 6 Magnus Enger 2016-04-26 10:51:58 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2016-04-26 18:11:23 UTC
Created attachment 50746 [details] [review]
Bug 16316 - Limit patron search to surname

This patch makes it possible to limit a patron search to
search just for surnames.

To test:
- Apply the patch
- Add two patrons, called e.g. "John Doe" and "Doe John"
- Go to Patrons in the Intranet
- Make sure you have selected "Search fields" = Standard
- Search for "john" and verify both patrons show up
- Search for "doe" and verify both patrons show up
- Set "Search fields" = Surname and search for "john".
  "Doe John" should show up, but not "John Doe".
- Set "Search fields" = Surname and search for "doe".
  "John Doe" should show up, but not "Doe John".

Update: Revised the last point in the test plan.

Sponsored-by: Alingsås Public Library, Sweden
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2016-04-26 18:11:27 UTC
Created attachment 50747 [details] [review]
Bug 16316 - QA FOLLOWUP - Add tests

Add 6 tests for searching by surname.

To test, run: prove t/db_dependent/Utils/Datatables_Members.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Kyle M Hall 2016-04-29 15:57:18 UTC
Pushed to master for the Koha 16.05 release. Thanks Magnus!