Bug 15818 - OPAC search with utf-8 characters and without results generates encoding...
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 15 Feb 2016 14:23:19 +0000 (15:23 +0100)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Mon, 22 Feb 2016 20:28:13 +0000 (20:28 +0000)
commitea69693997fa5ea6f6eef37290c783b507db1213
tree0df7705b1bd4c4f5f565e8562632977905adb032
parent43bcc1c42cd347ab1565b27038ec3350a1ecf94f
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.

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
opac/opac-search.pl