When OpacBrowseResults syspref is on, the detail page contains a results browser. When search therm contains non-ASCII character, the search query is not well encoded in this browser.
Created attachment 24113 [details] [review] Bug 11515 - Encoding problem with OpacBrowseResults When OpacBrowseResults syspref is on, the detail page contains a results browser. When search terms contains non-ASCII character, the search query is not well encoded in this browser. This patch adds the URI-coding to search terms into session to avoid any encoding problem with diacritics and URI specific characters like ?,& ... So that TT parameter 'busc' is already URI encoded and can be used to recreate seach URL. Test plan : - Set OpacBrowseResults on - At OPAC, perform a search with a diacritique. For example 'déjà' - Go to detail page of a result => You see browser under "Browser results" - Click on "Back to results" => You get same results and same search term with correct encoding
I don't experience this encoding issue, using queries with Norwegian characters or French diactric marks. The query is always correctly displayed. It's also displayed correctly after I apply the patch..
(In reply to Petter Goksøyr Åsen from comment #2) > I don't experience this encoding issue, using queries with Norwegian > characters or French diactric marks. The query is always correctly > displayed. It's also displayed correctly after I apply the patch.. Odd. When I test on master : - simple search at OPAC with "centré" - I have 5 results - I click on a result - I click on "Back to results" => I get the page : "cgi-bin/koha/opac-search.pl?idx=&q=centré", "centré" in search box and no results.
> Odd. > When I test on master : > - simple search at OPAC with "centré" > - I have 5 results > - I click on a result > - I click on "Back to results" > => I get the page : "cgi-bin/koha/opac-search.pl?idx=&q=centré", "centré" in search box and no results. Hm, I'm on master too. When I search for "øl", get 22 results, click on a result, click "Back to results", I get the page: => http://localhost:9000/cgi-bin/koha/opac-search.pl?q=%C3%B8l "øl" beeing url-encoded into %C3%B8l Its displayed correctly in the browser: => Results of search for 'kw,wrdl: øl' I notice you have idx= in your url, why I dont have that? I am very interested in any encoding-related bugs, because we also experience them on a seemingly random basis. It seems to me that it is not dealt with properly once and for all in Koha (ie. force utf-8 everywhere), but instead patched here and there, with the result that we sometimes get double-encoding issues. However, I do not know enough about Perl or Koha yet, so I might be totally wrong
(In reply to Petter Goksøyr Åsen from comment #4) > It seems to me that it is not dealt with properly once and for all in Koha > (ie. force utf-8 everywhere), but instead patched here and there, with the > result that we sometimes get double-encoding issues. However, I do not know > enough about Perl or Koha yet, so I might be totally wrong Well, this sounds (unfortunately) quite correct to me :)
(In reply to Petter Goksøyr Åsen from comment #4) > I notice you have idx= in your url, why I dont have that? I've tested with "øl". It works. Can you test with one of ê,é,è,à,â,ù ?
> I've tested with "øl". It works. I mean this patch is not needed for "øl".
> Can you test with one of ê,é,è,à,â,ù ? I did also try with french characters, It also works: => Results of search for 'kw,wrdl: andré' http://localhost:9000/cgi-bin/koha/opac-search.pl?q=andr%C3%A9 Same with à, ė & ê Can it be that your OS/browser submits the querystring with a French encoding?
Without patch, when searching "centré", I get in "Back to results" : opac-search.pl?idx=&q=centr%C3%83%C2%A9 My locale is "fr-FR.UTF-8". Seems this bug exists only since 3.14. Can you test on a fresh install ?
> Seems this bug exists only since 3.14. Can you test on a fresh install ? By fresh install, do you mean the debian package? And not from git master?
(In reply to Petter Goksøyr Åsen from comment #10) > > Seems this bug exists only since 3.14. Can you test on a fresh install ? > > By fresh install, do you mean the debian package? And not from git master? No, I mean an install created from scratch, not an existing install with sources updated to current master. If someone else could test, it would be great.
Patch tested with a sandbox, by Broust <jean-manuel.broust@univ-lyon2.fr>
Created attachment 26023 [details] [review] Bug 11515 - Encoding problem with OpacBrowseResults When OpacBrowseResults syspref is on, the detail page contains a results browser. When search terms contains non-ASCII character, the search query is not well encoded in this browser. This patch adds the URI-coding to search terms into session to avoid any encoding problem with diacritics and URI specific characters like ?,& ... So that TT parameter 'busc' is already URI encoded and can be used to recreate seach URL. Test plan : - Set OpacBrowseResults on - At OPAC, perform a search with a diacritique. For example 'déjà' - Go to detail page of a result => You see browser under "Browser results" - Click on "Back to results" => You get same results and same search term with correct encoding Signed-off-by: Broust <jean-manuel.broust@univ-lyon2.fr>
Fridolin, could you check this is still valid on current master? Also... patch doesn't apply.
Created attachment 32063 [details] [review] Bug 11515 - Encoding problem with OpacBrowseResults When OpacBrowseResults syspref is on, the detail page contains a results browser. When search terms contains non-ASCII character, the search query is not well encoded in this browser. This patch adds the URI-coding to search terms into session to avoid any encoding problem with diacritics and URI specific characters like ?,& ... So that TT parameter 'busc' is already URI encoded and can be used to recreate seach URL. Test plan : - Set OpacBrowseResults on - At OPAC, perform a search with a diacritique. For example 'déjà' - Go to detail page of a result => You see browser under "Browser results" - Click on "Back to results" => You get same results and same search term with correct encoding
(In reply to Katrin Fischer from comment #14) > Fridolin, could you check this is still valid on current master? Still exists withe actual test plan. > Also... patch doesn't apply. Patch rebased.
Created attachment 33084 [details] [review] Bug 11515 - Encoding problem with OpacBrowseResults
Works well. I do wonder if this is the level to solve this at, but it works!
Patch pushed to master. Thanks Frido!