Bug 14562

Summary: [3.18.x] Patron with empty card number will be only result returned by patron datatables search
Product: Koha Reporter: Jesse Weaver <jweaver>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, kyle.m.hall, liz, mirko
Version: 3.18   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14601
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13232
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 14562: All patrons returned if 1 has a cardnumber set to an empty string (Fix conflict with bug 12833)
Bug 14562: All patrons returned if 1 has a cardnumber set to an empty string (Fix conflict with bug 12833)
[PASSED QA] Bug 14562: All patrons returned if 1 has a cardnumber set to an empty string (Fix conflict with bug 12833)

Description Jesse Weaver 2015-07-18 01:12:39 UTC
Due to the fact that the if statement wrapping the single-patron search does not check that a cardnumber was passed, svc/members/search will attempt to search for a patron with an empty cardnumber. This should normally fail, but if such a patron exists (a possibility after importing/migrating) it will always succeed and prevent normal searching.
Comment 1 Jonathan Druart 2015-08-04 09:19:03 UTC
What kind of searches did you try?
I have a patron with cardnumber="", search by letter (browse by name), and different filter combinations work here.
Comment 2 Jesse Weaver 2015-08-06 23:15:14 UTC
Ah, on closer inspection, this is fixed by commit 481479fe627dcbabb3ef66df0724cc3fe75b110c: "Bug 12648: Fix conflict with bug 12833", which just needs to be backported to 3.18.
Comment 3 Jonathan Druart 2015-08-10 08:59:59 UTC Comment hidden (obsolete)
Comment 4 Mirko Tietgen 2015-08-12 12:12:41 UTC
Can't reproduce on 3.18.9.

I do a search for 't', then filter the results by search type or category. One of the patrons has an empty card number. Works for me.

Anything else I should try?
Comment 5 Jesse Weaver 2015-08-12 21:51:59 UTC
This error only occurs when you don't click on a first letter.
Comment 6 Joonas Kylmälä 2015-10-09 09:35:06 UTC Comment hidden (obsolete)
Comment 7 Katrin Fischer 2015-10-18 11:03:32 UTC
Created attachment 43568 [details] [review]
[PASSED QA] Bug 14562: All patrons returned if 1 has a cardnumber set to an empty string (Fix conflict with bug 12833)

This patch is a backport of (Bug 12648 is in 3.20.x, not 3.18.x):
commit 481479fe627dcbabb3ef66df0724cc3fe75b110c
    Bug 12648: Fix conflict with bug 12833

Test plan:
Set the cardnumber of one of the patron to an empty string
Do a patron search and use filters
The search will redirect to the patron detail page of the patron with
the empty string

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Liz Rea 2015-10-19 20:48:25 UTC
Pushed to 3.18.x will be in 3.18.12.