Bugzilla – Attachment 48225 Details for
Bug 15818
OPAC search with utf-8 characters and without results generates encoding error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15818 - OPAC search with utf-8 characters and without results generates encoding error
Bug-15818---OPAC-search-with-utf-8-characters-and-.patch (text/plain), 1.90 KB, created by
Marcel de Rooy
on 2016-02-19 09:34:15 UTC
(
hide
)
Description:
Bug 15818 - OPAC search with utf-8 characters and without results generates encoding error
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-02-19 09:34:15 UTC
Size:
1.90 KB
patch
obsolete
>From d043ae148adf9fe9a915b82d524c90d4d32fd152 Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Mon, 15 Feb 2016 15:23:19 +0100 >Subject: [PATCH] Bug 15818 - OPAC search with utf-8 characters and without > results generates encoding error >Content-Type: text/plain; charset=utf-8 > >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. >--- > opac/opac-search.pl | 1 - > 1 file changed, 1 deletion(-) > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 8157e7d..6a9403c 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -890,7 +890,6 @@ for (my $i=0;$i<@servers;$i++) { > if ($nohits and $nohits=~/{QUERY_KW}/){ > # extracting keywords in case of relaunching search > (my $query_kw=$query_desc)=~s/ and|or / /g; >- $query_kw = Encode::decode_utf8($query_kw); > my @query_kw=($query_kw=~ /([-\w]+\b)(?:[^,:]|$)/g); > $query_kw=join('+',@query_kw); > $nohits=~s/{QUERY_KW}/$query_kw/g; >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15818
:
48050
|
48051
| 48225