Bugzilla – Attachment 120626 Details for
Bug 28281
Installer doesn't work on some languages (pl-PL) because it double decodes installer data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28281: Remove double decoding when importing installation data
Bug-28281-Remove-double-decoding-when-importing-in.patch (text/plain), 2.19 KB, created by
Jonathan Druart
on 2021-05-06 13:01:26 UTC
(
hide
)
Description:
Bug 28281: Remove double decoding when importing installation data
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-05-06 13:01:26 UTC
Size:
2.19 KB
patch
obsolete
>From 7ba9a4e61f7286ee54748694aa8dfe3d55edcba6 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@helsinki.fi> >Date: Wed, 5 May 2021 12:12:44 +0300 >Subject: [PATCH] Bug 28281: Remove double decoding when importing installation > data > >The YAML::XS::Load and YAML::XS::LoadFile functions already decode the >YAML to Perl objects/strings, therefore decoding the output yet >another time is not needed and causes an error to happen. > >To test: > >1. Go through the following steps and notice without this patch the >error happens and with this patch it doesn't: > >$ koha-mysql kohadev < installer/data/mysql/kohastructure.sql >$ restart_all >$ ./translate update pl-PL >$ ./translate install pl-PL >$ restart_all > --> Go to the Koha web installer page and select pl-PL as the installer > language, click through it and notice it gives following error at the > MARC21 step: > > Cannot decode string with wide characters at /usr/lib/x86_64-linux-gnu/perl/5.24/Encode.pm line 202 > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/Installer.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/Installer.pm b/C4/Installer.pm >index 05b8025dbe3..2d6b523eed0 100644 >--- a/C4/Installer.pm >+++ b/C4/Installer.pm >@@ -154,7 +154,7 @@ sub marc_framework_sql_list { > my @lines; > if ( $ext =~ /yml/ ) { > my $yaml = YAML::XS::LoadFile("$dir/$requirelevel/$name\.$ext"); >- @lines = map { Encode::decode('UTF-8', $_) } @{ $yaml->{'description'} }; >+ @lines = @{ $yaml->{'description'} }; > } else { > open my $fh, "<:encoding(UTF-8)", "$dir/$requirelevel/$name.txt"; > my $line = <$fh>; >@@ -237,7 +237,7 @@ sub sample_data_sql_list { > my @lines; > if ( $ext =~ /yml/ ) { > my $yaml = YAML::XS::LoadFile("$dir/$requirelevel/$name\.$ext"); >- @lines = map { Encode::decode('UTF-8', $_) } @{ $yaml->{'description'} }; >+ @lines = @{ $yaml->{'description'} }; > } else { > open my $fh, "<:encoding(UTF-8)", "$dir/$requirelevel/$name.txt"; > my $line = <$fh>; >-- >2.20.1
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 28281
:
120484
|
120486
|
120626
|
120627
|
120678
|
120679