Bug 14871: Extend the patrons search to search like %$term% (checkout tab)
commit1e029d82ac0d34a64d4bab37fd60c89f71d47a13
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 22 Sep 2015 14:04:14 +0000 (22 15:04 +0100)
committerChris Cormack <chris@bigballofwax.co.nz>
Fri, 23 Oct 2015 13:06:39 +0000 (24 02:06 +1300)
tree0374413ddebe3d75eeb1ed516a141e8cefbe9539
parent0ff168c82ce940ef862e1d695c0e3ac66369dbe6
Bug 14871: Extend the patrons search to search like %$term% (checkout tab)

The patrons search used by the checkout tab and the autocomplete is not
the same as the "search patrons" tab.
The main difference is the "contain" vs "start with".
So that if you have a patron with a patron with a surname "foo bar" and
you search for "foo bar", the autocomplete and the result of a search by
the checkout tab will search for "foo%" or "bar%" which won't return the
patron you are search for.

This patch replaces both autocomplete and checkout tab searches with a
"contain" search. The search will be "%foo%" or "%bar%".
Note that on big DB, this can cause unexpected results.

Test plan:
Create a patron with a surname "foo bar"
Search for "bar" using the checkout tab.
You should see the patron in the autocomplete result and the result page
after submitting the search form.

Followed test plan, works as expected.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4353cd1958be8de81224647cbae62f5382b96eaa)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
circ/circulation.pl
circ/ysearch.pl