Bugzilla – Attachment 31908 Details for
Bug 13002
checkuniquemember capitalizes search names but not the names in DB
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13002 - checkuniquemember capitalizes search names but not the names in DB
Bug-13002---checkuniquemember-capitalizes-search-n.patch (text/plain), 1.92 KB, created by
Olli-Antti Kivilahti
on 2014-09-29 08:52:03 UTC
(
hide
)
Description:
Bug 13002 - checkuniquemember capitalizes search names but not the names in DB
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2014-09-29 08:52:03 UTC
Size:
1.92 KB
patch
obsolete
>From 10712f46ba9da5aa181480063fe1cd218fec65a9 Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Mon, 29 Sep 2014 11:47:00 +0300 >Subject: [PATCH] Bug 13002 - checkuniquemember capitalizes search names but > not the names in DB > >This causes matching to fail atleast in MariaDB/MySQL because they are case-sensitive. >--- > C4/Members.pm | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 0d96b01..d505779 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -1349,17 +1349,17 @@ sub checkuniquemember { > my ( $collectivity, $surname, $firstname, $dateofbirth ) = @_; > my $dbh = C4::Context->dbh; > my $request = ($collectivity) ? >- "SELECT borrowernumber,categorycode FROM borrowers WHERE surname=? " : >+ "SELECT borrowernumber,categorycode FROM borrowers WHERE upper(surname) = upper(?) " : > ($dateofbirth) ? >- "SELECT borrowernumber,categorycode FROM borrowers WHERE surname=? and firstname=? and dateofbirth=?" : >- "SELECT borrowernumber,categorycode FROM borrowers WHERE surname=? and firstname=?"; >+ "SELECT borrowernumber,categorycode FROM borrowers WHERE upper(surname) = upper(?) and upper(firstname) = upper(?) and dateofbirth=?" : >+ "SELECT borrowernumber,categorycode FROM borrowers WHERE upper(surname) = upper(?) and upper(firstname) = upper(?)"; > my $sth = $dbh->prepare($request); > if ($collectivity) { >- $sth->execute( uc($surname) ); >+ $sth->execute( $surname ); > } elsif($dateofbirth){ >- $sth->execute( uc($surname), ucfirst($firstname), $dateofbirth ); >+ $sth->execute( $surname, $firstname, $dateofbirth ); > }else{ >- $sth->execute( uc($surname), ucfirst($firstname)); >+ $sth->execute( $surname, $firstname); > } > my @data = $sth->fetchrow; > ( $data[0] ) and return $data[0], $data[1]; >-- >1.7.9.5
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 13002
: 31908