Bug 14955

Summary: "Show more" link contains double encoded characters
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: TemplatesAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: f.demians, joonas.kylmala, katrin.fischer, koha, tomascohen, veron
Version: master   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15059
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 13789    
Bug Blocks:    
Attachments: Bug 14955: Don't double encode chars in the "Show more" link
Bug 14955: Don't double encode chars in the "Show more" link
Bug 14955: Don't double encode chars in the "Show more" link
[PASSED QA] Bug 14955: Don't double encode chars in the "Show more" link

Description Jonathan Druart 2015-10-05 10:17:08 UTC

    
Comment 1 Jonathan Druart 2015-10-05 10:23:06 UTC Comment hidden (obsolete)
Comment 2 Joonas Kylmälä 2015-10-13 09:47:20 UTC
After doing the test plan you can't remove the filter item (author). If you click the |x| it will stay still there (and if you try again, it will just stay there....).
Comment 3 Jonathan Druart 2015-10-13 10:57:53 UTC
I have retried and it works here.
What is the url for the [x] link?
Comment 4 Joonas Kylmälä 2015-10-13 11:49:01 UTC
(In reply to Jonathan Druart from comment #3)
> I have retried and it works here.
> What is the url for the [x] link?

http://10.0.3.132/cgi-bin/koha/opac-search.pl?idx=kw&q=a&limit=au%3AHurme-Ker%C3%A4nen%2C%20Auli.&sort_by=relevance_dsc
Comment 5 Jonathan Druart 2015-10-13 13:07:30 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-10-13 13:08:01 UTC
Indeed, it worked for the intranet, not for the OPAC.
Comment 7 Jonathan Druart 2015-10-27 14:42:42 UTC
Encoding issue at the OPAC on a stable version, I am raising the severity to major.
Comment 8 Marc Véron 2015-10-28 09:24:55 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2015-11-01 19:09:00 UTC
I am failing to reproduce the problem - not sure what I am missing :(
Comment 10 Koha Team University Lyon 3 2015-11-04 14:55:18 UTC
Katrin,
I haven't test as explained by Jonathan but I have a similar problem : You perform a search with several pages of results. You go on the second page, click on "show more"  the URL contains space characters (I don't really know what sort of characters..) and if you click you don't have any result.
Sonia
Comment 11 Koha Team University Lyon 3 2015-11-04 15:37:34 UTC
I try Jonathan's patch. I confirm that it solves the problem described on the "show more" link (bad characters in the URL). But for me, the problem occurs only from the second page of results and it's not related to the fact of having a facet already selected. The problem exists whatever you have already selected a facet or not.
Comment 12 Katrin Fischer 2015-11-05 06:59:45 UTC
Created attachment 44454 [details] [review]
[PASSED QA] Bug 14955: Don't double encode chars in the "Show more" link

Bug 13789 has fixed this issue for the facet links (select/unselect) but
not for the "Show more" facets link.

This patch reuses the "url" variable, generated for the facets, for
these links. A new "local_url" variable is used to build links for each
entry.

Test plan (for OPAC and intranet):
- Search for a very common term
- Filter the results using facets
- You should get more than 5 entries for a facet and 1 selected:
Author
 author 1
 author 2 [x] # Selected
 author 3
 author 4
 author 5
 Show more # you see this link if there is 5+ values for this facet
- Click on the Show more link
Without this patch, the url contains double-encoded characters and you
will certainly don't get any results
With this patch, you should get results.

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Katrin Fischer 2015-11-05 07:00:45 UTC
I still have a bit of a problem reproducing the issue, but I can verify the change in the URL now and things seem to work like they should. Also trusting the other testers here.
Comment 14 Tomás Cohen Arazi 2015-11-05 12:54:54 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 15 Frédéric Demians 2015-11-29 20:19:57 UTC
This patch has been pushed to 3.20.x, will be in 3.20.6.