Summary: | Installer doesn't work on some languages (pl-PL) because it double decodes installer data | ||
---|---|---|---|
Product: | Koha | Reporter: | Joonas Kylmälä <joonas.kylmala> |
Component: | Installation and upgrade (web-based installer) | Assignee: | Joonas Kylmälä <joonas.kylmala> |
Status: | CLOSED FIXED | QA Contact: | Kyle M Hall (khall) <kyle> |
Severity: | major | ||
Priority: | P5 - low | CC: | fridolin.somers, gmcharlt, jonathan.druart, kyle, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28154 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.05.00
|
|
Circulation function: | |||
Bug Depends on: | 22824 | ||
Bug Blocks: | 27623 | ||
Attachments: |
Bug 28281: Remove double decoding when importing installation data
Bug 28281: Add tests Bug 28281: Remove double decoding when importing installation data Bug 28281: Add tests Bug 28281: Remove double decoding when importing installation data Bug 28281: Add tests |
hi :) Can't reproduce. Any hint ? I retried in case I did something different when testing bug 27623 The only thing I "improvised" was before the 1st step: echo "DROP DATABASE koha_kohadev; CREATE DATABASE koha_kohadev;" | koha-mysql kohadev ; restart_all Which is necessary right? What is the use of translate update in this case? (In reply to Victor Grousset/tuxayo from comment #2) > What is the use of translate update in this case? The encoding issue is coming from there. Joonas, any news on this? Created attachment 120484 [details] [review] 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 (In reply to Jonathan Druart from comment #3) > (In reply to Victor Grousset/tuxayo from comment #2) > > What is the use of translate update in this case? > > The encoding issue is coming from there. > > Joonas, any news on this? I have the fix only, attached it now but no tests yet. I'd gladly welcome help there or if you can wait probably will be able to make it in the coming days. (In reply to Victor Grousset/tuxayo from comment #2) > Can't reproduce. Any hint ? I retried in case I did something different when > testing bug 27623 No idea why you don't get it. Maybe for some reason you are using some other translation files compared to me? Created attachment 120486 [details] [review] Bug 28281: Add tests Created attachment 120626 [details] [review] 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> Created attachment 120627 [details] [review] Bug 28281: Add tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Nick, in case you are QA'ing this right now please check out also the bug 28291. Depending which translation data you have already you might need it. (In reply to Joonas Kylmälä from comment #10) > Nick, in case you are QA'ing this right now please check out also the bug > 28291. Depending which translation data you have already you might need it. Err, meant to say Kyle. Created attachment 120678 [details] [review] 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> Created attachment 120679 [details] [review] Bug 28281: Add tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Pushed to master for 21.05, thanks to everybody involved! Depends on Bug 22824 not in 20.11.x |
If trying to install Koha with pl-PL language it doesn't work due to double encoding error in C4/Installer.pm: $ koha-mysql kohadev < installer/data/mysql/kohastructure.sql $ restart_all $ ./translate update pl-PL $ ./translate install pl-PL $ restart_all --> Go to installer page and select pl-PL as installer language, click through it and notice it gives error: > Cannot decode string with wide characters at /usr/lib/x86_64-linux-gnu/perl/5.24/Encode.pm line 202 In installer the output of two calls YAML::XS::LoadFile is still decoded another time even though according to YAML::XS documentation the call to Load already decodes it. This causes the above error to happen in the MARC21 installation step.