Created attachment 3140 [details] [review] Proposed Patch
Isn't this in Koha already? If not can you explain more what it's supposed to do so I can test?
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
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).
Patch pushed, please test and mark resolved
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.
My apologies; apparently I got the commit IDs wrong. This is fine, the commit that touches members/member.pl before it is the culprit.