Summary: | OPAC search with utf-8 characters and without results generates encoding error | ||
---|---|---|---|
Product: | Koha | Reporter: | Dobrica Pavlinusic <dpavlin> |
Component: | Searching | Assignee: | Dobrica Pavlinusic <dpavlin> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | major | ||
Priority: | P5 - low | CC: | brendan, f.demians, jonathan.druart, julian.maurice, m.de.rooy |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 11944 | ||
Bug Blocks: | |||
Attachments: |
Bug 15818 - OPAC search with utf-8 characters and without results generates encoding error
Bug 15818 - OPAC search with utf-8 characters and without results generates encoding error Bug 15818 - OPAC search with utf-8 characters and without results generates encoding error |
Description
Dobrica Pavlinusic
2016-02-15 14:07:07 UTC
Created attachment 48050 [details] [review] Bug 15818 - OPAC search with utf-8 characters and without results generates encoding error When searching for something in OPAC which doesn't result in any results but have utf-8 characters in search string we get following encoding error: Cannot decode string with wide characters at /usr/lib/i386-linux-gnu/perl5/5.20/Encode.pm line 215. This is because we are trying to decode string which is allready correctly marked as utf-8. Test scenario: 1) enter search string with utf-8 characters in opac which doesn't return any results 2) verify that you get application error 3) apply this patch 4) re-run query and verify that errror is gone Created attachment 48051 [details] [review] Bug 15818 - OPAC search with utf-8 characters and without results generates encoding error When searching for something in OPAC which doesn't result in any results but have utf-8 characters in search string we get following encoding error: Cannot decode string with wide characters at /usr/lib/i386-linux-gnu/perl5/5.20/Encode.pm line 215. This is because we are trying to decode string which is allready correctly marked as utf-8. Test scenario: 1) enter search string with utf-8 characters in opac which doesn't return any results 2) verify that you get application error 3) apply this patch 4) re-run query and verify that errror is gone Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Step 0: Define "OPACNoResultsFound" with '{QUERY_KW}' Note that I don't get the error (Encode 2.60) but the search terms are not display correctly. Jonathan, I'm wondering do you have libencode-perl package installed or are you using Encode which ships with perl (and which version?). % dpkg -l | grep libencode-perl Does not return anything and % pmpath Encode /usr/lib/i386-linux-gnu/perl/5.20/Encode.pm % pmvers Encode 2.60 Interesting. I have libencode-perl which is 2.63 and I do get application error. I guess that built-in Encode is less strict, but anyway, this patch helps :-) Cannot reproduce this with Encode 2.42 Created attachment 48225 [details] [review] Bug 15818 - OPAC search with utf-8 characters and without results generates encoding error When searching for something in OPAC which doesn't result in any results but have utf-8 characters in search string we get following encoding error: Cannot decode string with wide characters at /usr/lib/i386-linux-gnu/perl5/5.20/Encode.pm line 215. This is because we are trying to decode string which is allready correctly marked as utf-8. Test scenario: 1) enter search string with utf-8 characters in opac which doesn't return any results 2) verify that you get application error 3) apply this patch 4) re-run query and verify that errror is gone Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Step 0: Define "OPACNoResultsFound" with '{QUERY_KW}' Note that I don't get the error (Encode 2.60) but the search terms are not display correctly. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> The variable to be decoded comes from already decoded vars (via the -utf8 flag from CGI), following the trail in Search.pm. pushed to master - should be in the may 2016 release. thanks! Patch pushed to 3.22.x, will be in 3.22.4 This patch has been pushed to 3.20.x, will be in 3.20.8. |