Bug 14524

Summary: Result list RSS feed broken
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: OPACAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: chris, jonathan.druart, katrin.fischer, liz, magnus, mtj, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 14418    
Bug Blocks:    
Attachments: Bug 14524: Don't escape query_cgi with uri
Bug 14524: Don't escape query_cgi with uri
[PASSED QA] Bug 14524: Don't escape query_cgi with uri

Description Katrin Fischer 2015-07-13 10:17:27 UTC
When subscribing to a RSS feed from the OPAC result list, no results are shown for it. Tested with a dynamic bookmark in Firefox.

Reason might be the use of |html instead of |url/uri as TT filter.

Tested in 3.18.8 so far, but I think other versions are probably also affected.
Comment 1 Magnus Enger 2015-07-13 11:02:45 UTC
Confirmed on current master.
Comment 2 Magnus Enger 2015-07-13 11:03:35 UTC
...and 3.20.1.
Comment 3 Magnus Enger 2015-07-13 11:07:43 UTC
I have this in the OPAC error log:

[Mon Jul 13 13:07:02.090923 2015] [cgi:error] [pid 4481] [client 127.0.0.1:55102] AH01215: [Mon Jul 13 13:07:02 2015] opac-search.pl: Use of uninitialized value in split at /home/magnus/scripts/kohaclone/opac/opac-search.pl line 501.
[Mon Jul 13 13:07:02.096514 2015] [cgi:error] [pid 4481] [client 127.0.0.1:55102] AH01215: [Mon Jul 13 13:07:02 2015] opac-search.pl: WARNING: query problem with   ZOOM error 10014 "CCL parsing error" (addinfo: "Search word expected") from diag-set 'ZOOM' at /home/magnus/scripts/kohaclone/C4/Search.pm line 379.

Not sure what is relevant.
Comment 4 Jonathan Druart 2015-07-13 14:42:38 UTC
Introduced by 14418.

Since query_cgi contains something like "idx=kw&q=42", we should not use the uri filter.
Comment 5 Jonathan Druart 2015-07-13 14:51:52 UTC Comment hidden (obsolete)
Comment 6 Chris Cormack 2015-07-13 21:07:44 UTC Comment hidden (obsolete)
Comment 7 Katrin Fischer 2015-07-16 22:39:36 UTC
Created attachment 41047 [details] [review]
[PASSED QA] Bug 14524: Don't escape query_cgi with uri

According to the doc, we should not escape query_cgi with the uri
filter:
http://www.template-toolkit.org/docs/manual/Filters.html#section_uri

Since query_cgi can contains something like: "idx=kw&q=42", we should
not escape the & char

Test plan:
0/ Don't apply the patch
1/ Go on launch a search at the OPAC
2/ Click on the RSS icon
3/ You should arrive on
opac-search.pl?idx%3Dkw%26q%3D42&count=50&sort_by=acqdate_dsc&format=rss2
The & has been escaped.
4/ Apply the patch
5/ Now you should get result and see an url correctly formatted.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Tomás Cohen Arazi 2015-07-20 13:27:20 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 9 Liz Rea 2015-07-20 22:23:05 UTC
Pushed to 3.18.x will be in 3.18.09
Comment 10 Chris Cormack 2015-07-21 21:07:02 UTC
Doesn't seem to effect translations pushed to 3.20.x will be in 3.20.2
Comment 11 Mason James 2015-07-25 13:13:29 UTC
Pushed to 3.16.x, will be in 3.16.13