Bug 5750

Summary: Add exact matching filter for categorycode and branchcode fields in search members's result
Product: Koha Reporter: Chris Cormack <chris>
Component: PatronsAssignee: Kyle M Hall <kyle.m.hall>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: enhancement    
Priority: PATCH-Sent (DO NOT USE) CC: gmcharlt, julian.maurice, katrin.fischer, koha.sekjal, nengard, paul.poulain
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 5575    
Attachments: Proposed Patch

Description Chris Cormack 2011-02-13 22:30:47 UTC

Comment 1 Chris Cormack 2011-02-13 22:36:57 UTC
Created attachment 3140 [details] [review]
Proposed Patch
Comment 2 Nicole C. Engard 2011-03-01 18:52:34 UTC
Isn't this in Koha already? If not can you explain more what it's supposed to do so I can test?
Comment 3 MJ Ray (software.coop) 2011-03-02 18:47:53 UTC
This bug is mentioned in:
Bug 5750: (MT #4095) add exact matching	filter for categorycode and branchcode fields in search	members's result http://lists.koha-community.org/pipermail/koha-patches/2011-February/013844.html
Comment 4 Katrin Fischer 2011-03-14 06:12:31 UTC
I ran into this problem in one of our installations (3.2.2) and master:

If you search for Staff (categorycode S) it will also bring up Schools and Students (SC, ST).

If you search for library A, it will also bring up borrowers from library AB (branchcode).
Comment 5 Chris Cormack 2011-03-15 09:13:10 UTC
Patch pushed, please test and mark resolved
Comment 6 Ian Walls 2011-04-01 20:30:15 UTC
This patch breaks patron search.

If both text and a branchcode or categorycode are specified, the text is ignored, and ALL matching patrons of either that branch or category (or both together) are returned, regardless of whether they meet the textual requirement.

A fix for this is particularly difficult to generate, because the root of the Search() routing is in C4::SQLHelper, a very complex and twisty module.
Comment 7 Ian Walls 2011-04-01 21:06:22 UTC
My apologies; apparently I got the commit IDs wrong.  This is fine, the commit that touches members/member.pl before it is the culprit.