Bugzilla – Attachment 10048 Details for
Bug 7411
remove diacritics when automatically generating userid
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7411: Remove diacritics from generated userid
Bug-7411-Remove-diacritics-from-generated-userid.patch (text/plain), 2.15 KB, created by
Katrin Fischer
on 2012-06-09 17:17:20 UTC
(
hide
)
Description:
Bug 7411: Remove diacritics from generated userid
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2012-06-09 17:17:20 UTC
Size:
2.15 KB
patch
obsolete
>From 1a604b5786eabd1a48b8b149a2f66b777fe34e7a Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <Katrin.Fischer.83@web.de> >Date: Sat, 9 Jun 2012 18:09:32 +0100 >Subject: [PATCH] Bug 7411: Remove diacritics from generated userid > >Patch introduces a new module Text::Unaccent. > >To test: >1) Add a new patron with diacritics in surname and first name, leave userid empty. >2) Save user and check the created userid has only the base characters and >diacritics have been removed correctly. >3) Create another user with the same surname and first name, check userid >is generated correctly. >--- > C4/Members.pm | 2 ++ > debian/control | 1 + > install_misc/debian.packages | 1 + > 3 files changed, 4 insertions(+) > >diff --git a/C4/Members.pm b/C4/Members.pm >index ce54952..fd25844 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -38,6 +38,7 @@ use C4::NewsChannels; #get slip news > use DateTime; > use DateTime::Format::DateParse; > use Koha::DateUtils; >+use Text::Unaccent qw( unac_string ); > > our ($VERSION,@ISA,@EXPORT,@EXPORT_OK,$debug); > >@@ -800,6 +801,7 @@ sub Generate_Userid { > $firstname =~ s/[[:digit:][:space:][:blank:][:punct:][:cntrl:]]//g; > $surname =~ s/[[:digit:][:space:][:blank:][:punct:][:cntrl:]]//g; > $newuid = lc(($firstname)? "$firstname.$surname" : $surname); >+ $newuid = unac_string('utf-8',$newuid); > $newuid .= $offset unless $offset == 0; > $offset++; > >diff --git a/debian/control b/debian/control >index bf4d3e0..588c641 100644 >--- a/debian/control >+++ b/debian/control >@@ -72,6 +72,7 @@ Build-Depends: libcgi-session-driver-memcached-perl, > libtext-csv-perl, > libtext-csv-xs-perl, > libtext-iconv-perl, >+ libtext-unaccent-perl, > libuniversal-require-perl, > liburi-perl, > libwww-perl, >diff --git a/install_misc/debian.packages b/install_misc/debian.packages >index 4406e3d..153bcb7 100644 >--- a/install_misc/debian.packages >+++ b/install_misc/debian.packages >@@ -83,6 +83,7 @@ libtext-charwidth-perl install > libtext-csv-encoded-perl install > libtext-csv-perl install > libtext-iconv-perl install >+libtext-unaccent-perl install > libtext-wrapi18n-perl install > libtimedate-perl install > libtime-duration-perl install >-- >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 7411
:
7064
|
10048
|
10049
|
10735
|
10800