Bug 23132

Summary: Encoding issues in facets with show more link
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: SearchingAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart, julian.maurice, lucas
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22903
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.02
Bug Depends on: 21526    
Bug Blocks:    
Attachments: Bug 23132: Fix encoding issues in facets with show more link
Bug 23132: Fix encoding issues in facets with show more link
Bug 23132: Fix encoding issues in facets with show more link

Description Fridolin Somers 2019-06-17 14:25:03 UTC
When one uses characters like é, à, ç ... the first search show up correctly but when you refine your search with "Show more", the encoding becomes bad and so, results of the search too.
Comment 1 Fridolin Somers 2019-06-17 14:25:52 UTC
A quick fix of Bug 22903 problem
Comment 2 Fridolin Somers 2019-06-17 14:27:27 UTC
Same fix as commit :
Bug 21526: Fix search result pages (url vs uri vs raw)
Comment 3 Fridolin Somers 2019-06-17 14:31:11 UTC
Created attachment 90673 [details] [review]
Bug 23132: Fix encoding issues in facets with show more link

When one uses characters like Ã, ç ... the first searcshow up correctly but when you refine your search with "Show more", the encoding becomes bad and so, results of the search too.

Test plan :

Without the patch:
- check if you have your SysPref SearchEngine with Elasticsearch as value,
- put your SysPref FacetMaxCount at 10,
- search in the catalog "a" and then in Refine your search click on show more (just to see how it works),
- then search with special characters like "é", ç" ... and make the same test, the research should be wrong when you click on show more and the page is realoaded.

Then apply the patch:
- and make the same with a classic reasearch, then with special characters,
- verify that when you click on show more the page isn't realoded and the reasearch is correct.
- same with show less
- and finnaly, add some facets and test show more/less
Comment 4 Jonathan Druart 2019-06-19 02:52:37 UTC
(In reply to Fridolin SOMERS from comment #2)
> Same fix as commit :
> Bug 21526: Fix search result pages (url vs uri vs raw)

I do not understand which part of this patch you are referring to.
Comment 5 Jonathan Druart 2019-06-19 02:57:14 UTC
(In reply to Jonathan Druart from comment #4)
> (In reply to Fridolin SOMERS from comment #2)
> > Same fix as commit :
> > Bug 21526: Fix search result pages (url vs uri vs raw)
> 
> I do not understand which part of this patch you are referring to.

Ok got it. The $raw was used in opac-facets.inc, not facets.inc
Comment 6 Jonathan Druart 2019-06-19 02:58:53 UTC
Created attachment 90767 [details] [review]
Bug 23132: Fix encoding issues in facets with show more link

When one uses characters like Ã, ç ... the first searcshow up correctly but when you refine your search with "Show more", the encoding becomes bad and so, results of the search too.

Test plan :

Without the patch:
- check if you have your SysPref SearchEngine with Elasticsearch as value,
- put your SysPref FacetMaxCount at 10,
- search in the catalog "a" and then in Refine your search click on show more (just to see how it works),
- then search with special characters like "é", ç" ... and make the same test, the research should be wrong when you click on show more and the page is realoaded.

Then apply the patch:
- and make the same with a classic reasearch, then with special characters,
- verify that when you click on show more the page isn't realoded and the reasearch is correct.
- same with show less
- and finnaly, add some facets and test show more/less

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Julian Maurice 2019-06-19 13:15:32 UTC
Created attachment 90788 [details] [review]
Bug 23132: Fix encoding issues in facets with show more link

When one uses characters like Ã, ç ... the first searcshow up correctly but when you refine your search with "Show more", the encoding becomes bad and so, results of the search too.

Test plan :

Without the patch:
- check if you have your SysPref SearchEngine with Elasticsearch as value,
- put your SysPref FacetMaxCount at 10,
- search in the catalog "a" and then in Refine your search click on show more (just to see how it works),
- then search with special characters like "é", ç" ... and make the same test, the research should be wrong when you click on show more and the page is realoaded.

Then apply the patch:
- and make the same with a classic reasearch, then with special characters,
- verify that when you click on show more the page isn't realoded and the reasearch is correct.
- same with show less
- and finnaly, add some facets and test show more/less

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 8 Martin Renvoize 2019-06-20 08:34:00 UTC
Nice work!

Pushed to master for 19.11.00
Comment 9 Fridolin Somers 2019-07-15 13:31:02 UTC
Pushed to 19.05.x for 19.05.02
Comment 10 Lucas Gass 2019-08-14 17:22:00 UTC
backported to 18.11.x for 18.11.09