Bugzilla – Attachment 19251 Details for
Bug 8798
Add the use of DBIx::Class
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Testing DBIx::Class, continued
Testing-DBIxClass-continued.patch (text/plain), 2.95 KB, created by
Paul Poulain
on 2013-06-26 19:01:28 UTC
(
hide
)
Description:
Testing DBIx::Class, continued
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2013-06-26 19:01:28 UTC
Size:
2.95 KB
patch
obsolete
>From d7eba3d9530696d8a04a6eef9a59a6ad7b13826c Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Wed, 26 Jun 2013 20:45:46 +0200 >Subject: [PATCH] Testing DBIx::Class, continued >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >I tried to replace the GetBranchesLoop() call in C4/Auth.pm >In my database, there is a branchname with a diacritic. Unfortunately, it's not properly handled: >"Institut Protestant de Th�ologie" appears instead of "Institut Protestant de Théologie" > >If I force the page encoding to latin1, it appears correctly. >Investigating DBIx::Class documentation, I find a Using Unicode chapter in DBIx::Class::Manual::Cookbook >which says: > MySQL supports unicode, and will correctly flag utf8 data from the database if the "mysql_enable_utf8" is set in the > connect options. > > my $schema = My::Schema->connection('dbi:mysql:dbname=test', > $user, $pass, > { mysql_enable_utf8 => 1} ); > > When set, a data retrieved from a textual column type (char, varchar, etc) will have the UTF-8 flag turned on if > necessary. This enables character semantics on that string. You will also need to ensure that your database / table / > column is configured to use UTF8. See Chapter 10 of the mysql manual for details. > > See DBD::mysql for further details. > >This patch also adds the >+ mysql_enable_utf8 => 1, # REQUIRED to handle properly utf8 > >line, but unfortunately, it does not fix the problem. ideas welcomed... > >http://bugs.koha-community.org/show_bug.cgi?id=8798 >--- > C4/Auth.pm | 3 ++- > Koha/Database.pm | 5 ++++- > 2 files changed, 6 insertions(+), 2 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 3c0b804..befa487 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -984,8 +984,9 @@ sub checkauth { > > my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tmpl' : 'auth.tmpl'; > my $template = C4::Templates::gettemplate($template_name, $type, $query ); >+ my @branchloop= Koha::BusinessLogic::Branch->read()->all; > $template->param( >- branchloop => GetBranchesLoop(), >+ branchloop => \@branchloop, > opaccolorstylesheet => C4::Context->preference("opaccolorstylesheet"), > opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"), > login => 1, >diff --git a/Koha/Database.pm b/Koha/Database.pm >index c10a61a..5fe6392 100644 >--- a/Koha/Database.pm >+++ b/Koha/Database.pm >@@ -63,7 +63,10 @@ sub _new_schema { > my $db_passwd = $context->config("pass"); > my $schema = Koha::Schema->connect( > "DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port", >- $db_user, $db_passwd ); >+ $db_user, $db_passwd, >+ { >+ mysql_enable_utf8 => 1, # REQUIRED to handle properly utf8 >+ }); > return $schema; > } > >-- >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 8798
:
12403
|
12405
|
12429
|
12439
|
12442
|
12443
|
12453
|
12477
|
12478
|
12480
|
12481
|
12506
|
12520
|
12521
|
12538
|
17581
|
17582
|
17583
|
17584
|
17585
|
17586
|
19134
|
19137
|
19138
|
19139
|
19140
|
19141
|
19248
|
19249
|
19250
|
19251