[Bug 37801] New: Search results with limits create URLs that cause XML errors in RSS2 output
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Bug ID: 37801 Summary: Search results with limits create URLs that cause XML errors in RSS2 output Change sponsored?: --- Product: Koha Version: 23.11 Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Searching Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org To reproduce: 1. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl 2. Limit to "Books" and click "Search" 3. Click the RSS icon 4. Note the XML parsing error: This page contains the following errors: error on line 1 at column 364: EntityRef: expecting ';' Below is a rendering of the page up to the first error. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |phil@chetcolibrary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 --- Comment #1 from Phil Ringnalda <phil@chetcolibrary.org> --- Created attachment 171043 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171043&action=edit Bug 37801: Search results with limits create URLs that cause XML errors in RSS and Atom output The template for RSS and Atom feeds of search results (curiously named opac-opensearch.tt) is careful to escape ampersands in the query_cgi param while adding it to URLs, but doesn't escape the limit_cgi param at all. It should. Two drive-by fixes for Atom: because the <title> when your search has a limit includes , which isn't an XML character entity, you couldn't get as far as the error from the <link> URL, and as long as I was going to have blame for the line, I couldn't bear to leave the stray undefined SEARCH_RESULT. in the (hard-coded and bogus) <link rel="last">. Test plan: 1. In the OPAC, Advanced search - check the boxes to limit by item type Books and Mixed Materials and search for the keyword Perl 2. At the top of the search results, click the orange RSS icon 3. That gives you an ugly "not well-formed" error, so in the URL for the page change the final "format=rss" to "format=atom" 4. That gives you an ugly "undefined entity" error, so apply the patch 5. Reload the page with the Atom feed, it should change from an error page to a garbled display of the feed. Click Back to go back to the RSS feed and reload it if it's still cached on the error page. That should give a pretty-printed display of the RSS feed without parsing errors Sponsored-by: Chetco Community Public Library -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |phil@chetcolibrary.org |ity.org | Version|23.11 |Main -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Sukhmandeep <sukhmandeep.benipal@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sukhmandeep.benipal@inLibro | |.com --- Comment #2 from Sukhmandeep <sukhmandeep.benipal@inLibro.com> --- Created attachment 171290 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171290&action=edit Screenshot of the result after patch is applied Hi Phil, I’ve completed the test plan, and everything seems to be functioning as expected. However, I’m unsure about the part that states, "That should give a pretty-printed display of the RSS feed without parsing errors." I’ve attached a screenshot of the result I obtained. Could you please confirm if this matches the expected outcome? Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 --- Comment #3 from Phil Ringnalda <phil@chetcolibrary.org> --- Yes, that's perfect. Sorry for being unclear, pretty-printed is the Firefox rendering engine's internal name for that particular display of XML, and this is the first time I've ever mentioned it to anyone who wasn't involved in creating it, so it didn't occur to me that nobody else knows that's what it's called :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 --- Comment #4 from Sukhmandeep <sukhmandeep.benipal@inLibro.com> --- Ah, got it. Everything seems to be functioning as expected, so I'll sign off this bug. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Sukhmandeep <sukhmandeep.benipal@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171043|0 |1 is obsolete| | --- Comment #5 from Sukhmandeep <sukhmandeep.benipal@inLibro.com> --- Created attachment 171293 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171293&action=edit Bug 37801: Search results with limits create URLs that cause XML errors in RSS and Atom output The template for RSS and Atom feeds of search results (curiously named opac-opensearch.tt) is careful to escape ampersands in the query_cgi param while adding it to URLs, but doesn't escape the limit_cgi param at all. It should. Two drive-by fixes for Atom: because the <title> when your search has a limit includes , which isn't an XML character entity, you couldn't get as far as the error from the <link> URL, and as long as I was going to have blame for the line, I couldn't bear to leave the stray undefined SEARCH_RESULT. in the (hard-coded and bogus) <link rel="last">. Test plan: 1. In the OPAC, Advanced search - check the boxes to limit by item type Books and Mixed Materials and search for the keyword Perl 2. At the top of the search results, click the orange RSS icon 3. That gives you an ugly "not well-formed" error, so in the URL for the page change the final "format=rss" to "format=atom" 4. That gives you an ugly "undefined entity" error, so apply the patch 5. Reload the page with the Atom feed, it should change from an error page to a garbled display of the feed. Click Back to go back to the RSS feed and reload it if it's still cached on the error page. That should give a pretty-printed display of the RSS feed without parsing errors Sponsored-by: Chetco Community Public Library Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Sukhmandeep <sukhmandeep.benipal@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171293|0 |1 is obsolete| | --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 171305 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171305&action=edit Bug 37801: Search results with limits create URLs that cause XML errors in RSS and Atom output The template for RSS and Atom feeds of search results (curiously named opac-opensearch.tt) is careful to escape ampersands in the query_cgi param while adding it to URLs, but doesn't escape the limit_cgi param at all. It should. Two drive-by fixes for Atom: because the <title> when your search has a limit includes , which isn't an XML character entity, you couldn't get as far as the error from the <link> URL, and as long as I was going to have blame for the line, I couldn't bear to leave the stray undefined SEARCH_RESULT. in the (hard-coded and bogus) <link rel="last">. Test plan: 1. In the OPAC, Advanced search - check the boxes to limit by item type Books and Mixed Materials and search for the keyword Perl 2. At the top of the search results, click the orange RSS icon 3. That gives you an ugly "not well-formed" error, so in the URL for the page change the final "format=rss" to "format=atom" 4. That gives you an ugly "undefined entity" error, so apply the patch 5. Reload the page with the Atom feed, it should change from an error page to a garbled display of the feed. Click Back to go back to the RSS feed and reload it if it's still cached on the error page. That should give a pretty-printed display of the RSS feed without parsing errors Sponsored-by: Chetco Community Public Library Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |jonathan.druart@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 --- Comment #8 from Owen Leonard <oleonard@myacpl.org> ---
The template for RSS and Atom feeds of search results (curiously named opac-opensearch.tt)
The name was related to this: https://en.wikipedia.org/wiki/OpenSearch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baptiste.wojtkowski@biblibr | |e.com --- Comment #9 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- *** Bug 38238 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_24_05_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_24_05_candidate | Status|Pushed to main |Pushed to stable CC| |lucas@bywatersolutions.com Version(s)|24.11.00 |24.11.00,24.05.05 released in| | --- Comment #10 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|24.11.00,24.05.05 |24.11.00,24.05.05,23.11.11 released in| | CC| |fridolin.somers@biblibre.co | |m --- Comment #11 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37801 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |wainuiwitikapark@catalyst.n | |et.nz Status|Pushed to oldstable |RESOLVED --- Comment #12 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org