Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere
Summary: plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Dobrica Pavlinusic
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 11944
Blocks: 13791 15970
  Show dependency treegraph
 
Reported: 2015-03-10 12:29 UTC by Dobrica Pavlinusic
Modified: 2016-12-05 21:23 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere (1.35 KB, patch)
2015-03-10 12:37 UTC, Dobrica Pavlinusic
Details | Diff | Splinter Review
Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere (1.27 KB, patch)
2015-03-17 11:15 UTC, Dobrica Pavlinusic
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere (1.32 KB, patch)
2015-04-20 09:14 UTC, Gaetan Boisson
Details | Diff | Splinter Review
Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere (1.38 KB, patch)
2015-06-04 14:11 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.