Bugzilla – Attachment 42799 Details for
Bug 14871
Cannot search for patrons using second surname/firstname
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[Signed-off] Bug 14871: Extend the patrons search to search like %$term% (checkout tab)
Signed-off-Bug-14871-Extend-the-patrons-search-to-.patch (text/plain), 2.21 KB, created by
Marc Véron
on 2015-09-22 17:32:27 UTC
(
hide
)
Description:
[Signed-off] Bug 14871: Extend the patrons search to search like %$term% (checkout tab)
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-09-22 17:32:27 UTC
Size:
2.21 KB
patch
obsolete
>From 4ff1209a3ae0017f7c121562a4bcdc823ecdfcb1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 22 Sep 2015 15:04:14 +0100 >Subject: [PATCH] [Signed-off] Bug 14871: Extend the patrons search to search > like %$term% (checkout tab) >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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> >--- > circ/circulation.pl | 1 + > circ/ysearch.pl | 4 ++-- > 2 files changed, 3 insertions(+), 2 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 8b2d8d8..60db4e9 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -214,6 +214,7 @@ if ($findborrower) { > my $results = C4::Utils::DataTables::Members::search( > { > searchmember => $findborrower, >+ searchtype => 'contain', > dt_params => $dt_params, > } > ); >diff --git a/circ/ysearch.pl b/circ/ysearch.pl >index 518915f..74e14ee 100755 >--- a/circ/ysearch.pl >+++ b/circ/ysearch.pl >@@ -57,8 +57,8 @@ foreach my $p (@parts) { > push( > @params, > -or => [ >- surname => { -like => "$p%" }, >- firstname => { -like => "$p%" }, >+ surname => { -like => "%$p%" }, >+ firstname => { -like => "%$p%" }, > cardnumber => { -like => "$p%" }, > ] > ); >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14871
:
42786
|
42799
|
42938
|
43044