Bug 17352 - Patron search type is hard coded to 'contain' in circ/circulation.pl
Summary: Patron search type is hard coded to 'contain' in circ/circulation.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Kyle M Hall (khall)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-26 16:38 UTC by Barton Chittenden
Modified: 2017-06-14 22:13 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:
Circulation function:


Attachments
Bug 17352 - Patron search type is hard coded to 'contain' in circ/circulation.pl (1.94 KB, patch)
2016-09-26 16:51 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 17352 - Patron search type is hard coded to 'contain' in circ/circulation.pl (1.99 KB, patch)
2016-09-27 05:46 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17352 - Patron search type is hard coded to 'contain' in circ/circulation.pl (2.06 KB, patch)
2016-09-27 14:46 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 Barton Chittenden 2016-09-26 16:38:04 UTC
The patron search type is hard coded to 'contain' in circ/circulation.pl.

This causes problems because a mis-scanned cardnumber can bring up the wrong patron.

The example that our partner gave us involved scanning '1733', which doesn't match any borrowers when we do a 'start_with' search, but matches the cardnumber 'p291733'.

If we follow the usage in members/member.pl, we can set searchtype in HTTP params, which is amenable to fixes in intranetuserjs
Comment 1 Kyle M Hall (khall) 2016-09-26 16:51:14 UTC
Created attachment 55823 [details] [review]
Bug 17352 - Patron search type is hard coded to 'contain' in circ/circulation.pl

The patron search type is hard coded to 'contain' in
circ/circulation.pl.

This causes problems because a mis-scanned cardnumber can bring up the
wrong patron.

The example that our partner gave us involved scanning '1733', which
doesn't match any borrowers when we do a 'start_with' search, but
matches the cardnumber 'p291733'.

If we follow the usage in members/member.pl, we can set searchtype in
HTTP params, which is amenable to fixes in intranetuserjs

Test Plan:
1) Apply this patch
2) Use the checkout search, not changes should be noted

Extra credit:
1) Add javascript to intranetuserjs to add a hidden input named
'searchtype' with the value 'start_with'
2) Checkout searches should now give only results where a searched
   field starts with the given string(s)
Comment 2 Josef Moravec 2016-09-27 05:46:36 UTC
Created attachment 55832 [details] [review]
Bug 17352 - Patron search type is hard coded to 'contain' in circ/circulation.pl

The patron search type is hard coded to 'contain' in
circ/circulation.pl.

This causes problems because a mis-scanned cardnumber can bring up the
wrong patron.

The example that our partner gave us involved scanning '1733', which
doesn't match any borrowers when we do a 'start_with' search, but
matches the cardnumber 'p291733'.

If we follow the usage in members/member.pl, we can set searchtype in
HTTP params, which is amenable to fixes in intranetuserjs

Test Plan:
1) Apply this patch
2) Use the checkout search, not changes should be noted

Extra credit:
1) Add javascript to intranetuserjs to add a hidden input named
'searchtype' with the value 'start_with'
2) Checkout searches should now give only results where a searched
   field starts with the given string(s)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Tested with extra ;)
Comment 3 Jonathan Druart 2016-09-27 14:46:05 UTC
Created attachment 55843 [details] [review]
Bug 17352 - Patron search type is hard coded to 'contain' in circ/circulation.pl

The patron search type is hard coded to 'contain' in
circ/circulation.pl.

This causes problems because a mis-scanned cardnumber can bring up the
wrong patron.

The example that our partner gave us involved scanning '1733', which
doesn't match any borrowers when we do a 'start_with' search, but
matches the cardnumber 'p291733'.

If we follow the usage in members/member.pl, we can set searchtype in
HTTP params, which is amenable to fixes in intranetuserjs

Test Plan:
1) Apply this patch
2) Use the checkout search, not changes should be noted

Extra credit:
1) Add javascript to intranetuserjs to add a hidden input named
'searchtype' with the value 'start_with'
2) Checkout searches should now give only results where a searched
   field starts with the given string(s)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Kyle M Hall (khall) 2016-09-27 15:20:46 UTC
Pushed to master, thanks for the quick turnaround on this Josef, Jonathan!
Comment 5 Kyle M Hall (khall) 2016-09-27 15:21:13 UTC
Pushed to master for 16.11
Comment 6 Frédéric Demians 2016-10-22 08:10:40 UTC
Pushed in 16.05. Will be in 16.05.05.
Comment 7 Julian Maurice 2016-10-24 09:36:18 UTC
Pushed to 3.22.x, will be in 3.22.12