Bugzilla – Attachment 97174 Details for
Bug 14759
Replacement for Text::Unaccent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14759: Replace Text::Unaccent with Unicode::Normalize
Bug-14759-Replace-TextUnaccent-with-UnicodeNormali.patch (text/plain), 2.10 KB, created by
Marcel de Rooy
on 2020-01-10 10:19:19 UTC
(
hide
)
Description:
Bug 14759: Replace Text::Unaccent with Unicode::Normalize
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-01-10 10:19:19 UTC
Size:
2.10 KB
patch
obsolete
>From c0cc22c34b92f416275b9e42dd30796842b7db93 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 8 Jan 2020 09:13:18 +0000 >Subject: [PATCH] Bug 14759: Replace Text::Unaccent with Unicode::Normalize >Content-Type: text/plain; charset=utf-8 > >As shown in the comments on the bug, it appears that Unicode::Normalize >is the most reliable way to strip accents from strings for this use >case. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Installer/PerlDependencies.pm | 5 ----- > Koha/Patron.pm | 6 +++--- > 2 files changed, 3 insertions(+), 8 deletions(-) > >diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm >index d553961cc5..84f5fe4930 100644 >--- a/C4/Installer/PerlDependencies.pm >+++ b/C4/Installer/PerlDependencies.pm >@@ -627,11 +627,6 @@ our $PERL_DEPS = { > required => 0, > min_ver => '0.40' > }, >- 'Text::Unaccent' => { >- 'usage' => 'Core', >- 'required' => '1', >- 'min_ver' => '1.08', >- }, > 'Test::WWW::Mechanize' => { > 'usage' => 'Testing suite', > 'required' => '0', >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index a3ebfc9b2e..f48e67a696 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -23,7 +23,7 @@ use Modern::Perl; > use Carp; > use List::MoreUtils qw( any uniq ); > use JSON qw( to_json ); >-use Text::Unaccent qw( unac_string ); >+use Unicode::Normalize; > > use C4::Context; > use C4::Log; >@@ -1419,14 +1419,14 @@ sub generate_userid { > $firstname =~ s/[[:digit:][:space:][:blank:][:punct:][:cntrl:]]//g; > $surname =~ s/[[:digit:][:space:][:blank:][:punct:][:cntrl:]]//g; > my $userid = lc(($firstname)? "$firstname.$surname" : $surname); >- $userid = unac_string('utf-8',$userid); >+ $userid = NFKD( $userid ); >+ $userid =~ s/\p{NonspacingMark}//g; > $userid .= $offset unless $offset == 0; > $self->userid( $userid ); > $offset++; > } while (! $self->has_valid_userid ); > > return $self; >- > } > > =head3 attributes >-- >2.11.0
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 14759
:
42120
|
96974
|
97099
|
97100
| 97174 |
97175