Bug 13815

Summary: plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere
Product: Koha Reporter: Dobrica Pavlinusic <dpavlin>
Component: Architecture, internals, and plumbingAssignee: Dobrica Pavlinusic <dpavlin>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: abl, chris, gaetan.boisson, jonathan.druart, robin, tomascohen, wizzyrea
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 11944    
Bug Blocks: 13791, 15970    
Attachments: Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere
Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere
[SIGNED-OFF] Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere
Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere

Description Dobrica Pavlinusic 2015-03-10 12:29:47 UTC

    
Comment 1 Dobrica Pavlinusic 2015-03-10 12:37:19 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2015-03-10 14:45:11 UTC
Hi Dobrica,
I get the problem on the patron search, but not on searching biblios.
IMO we should remove the warns in the psgi file, don't you think?
Comment 3 Dobrica Pavlinusic 2015-03-10 23:11:23 UTC
Sure, this is just a quick code drop. I think that my production in now ready to be updated to master with plack.

I also need to suppress warning.
Comment 4 Dobrica Pavlinusic 2015-03-17 11:15:59 UTC Comment hidden (obsolete)
Comment 5 Gaetan Boisson 2015-04-20 09:14:42 UTC Comment hidden (obsolete)
Comment 6 Gaetan Boisson 2015-04-20 09:24:01 UTC
Works and solved a large number of issues for us!

Is the syspref cache clearing also involved in encoding problems?
Comment 7 Jonathan Druart 2015-06-04 14:11:49 UTC
Created attachment 39865 [details] [review]
Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere

This is major problem for plack installations with utf-8 encoding.

In this case, we are overriding CGI->new to setup utf-8 flag and
get correctly decoded $cgi->params, and reset syspref cache using
C4::Context->clear_syspref_cache

Test scenario:
1. under plack try to search with utf-8 charactes
2. try to find patron with utf-8 characters

Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Comment 8 Tomás Cohen Arazi 2015-06-04 14:16:49 UTC
Patch pushed to master.

Thanks Dobrica!
Comment 9 Jonathan Druart 2015-06-04 14:19:19 UTC
(In reply to Gaetan Boisson from comment #6)
> Works and solved a large number of issues for us!
> 
> Is the syspref cache clearing also involved in encoding problems?

Actually you are right, this should not be done here.

We should remove this call.
Comment 10 Chris Cormack 2015-06-07 08:19:09 UTC
Pushed to 3.20.x will be in 3.20.1
Comment 11 Liz Rea 2015-06-22 22:42:09 UTC
Patch pushed to 3.18.x will be in 3.18.08
Comment 12 Jonathan Druart 2015-06-23 08:02:45 UTC
(In reply to Liz Rea from comment #11)
> Patch pushed to 3.18.x will be in 3.18.08

Liz, this patch should not have been pushed to 3.18.x, it depends on bug 11944 which is only in 3.20.
There is at least 1 regression on facets.