[Bug 14716] New: opac-detail.pl -- Series link fails when series title ends with semicolon preceded by space.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Bug ID: 14716 Summary: opac-detail.pl -- Series link fails when series title ends with semicolon preceded by space. Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Searching Assignee: gmcharlt@gmail.com Reporter: barton@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Created attachment 41870 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41870&action=edit marc record with test data To reproduce Add a bib with the following data in biblioitems.marcxml: <datafield tag="440" ind1=" " ind2="0"> <subfield code="a">Magic tree house ;</subfield> <subfield code="v">#6</subfield> <subfield code="9">39181</subfield> </datafield> [the attached bib-14675.utf8 contains just such a record] Make sure that the fast indexer picks up the record. In the opac a title search for the bib; this should bring up opac-detail.pl Using view source The 'Series' link looks like this: <a href="/cgi-bin/koha/opac-search.pl?q=se,phr:%22Magic%20tree%20house%20;%22">Magic tree house ; #6</a> When url-decoded, the href looks like /cgi-bin/koha/opac-search.pl?q=se,phr:"Magic tree house ;" ... this will not return any search results When the trailing space and semicolon is removed: /cgi-bin/koha/opac-search.pl?q=se,phr:"Magic tree house" The resulting string can be url-encoded and appended to the opac base url -- this will return search results. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle.m.hall@gmail.com --- Comment #1 from Kyle M Hall <kyle.m.hall@gmail.com> --- This is happening because the query is malformed. Take for example the query se,phr:"Frank%20Einstein%20;" which is se,phr:"Frank Einstein" but the semicolon is truncating the query so it looks to Koha se,phr:"Frank Einstein which is not a problem on the staff side. Zebra seems to deal with this ok. On the opac side though, we are adding on supression, so the query ends up like this: (se,phr:"Frank Einstein ) not Suppress=1 which zebra chokes on. Removing the semicolon from the subject heading would fix this, but I imagine that's a band-aid as the semi is part of the standard. The semi is being treated as an ampersand. This is deep in the machinery ( http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2 ) Basically, the semi needs to be url encoded as %3B -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |kyle.m.hall@gmail.com Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 --- Comment #2 from Kyle M Hall <kyle.m.hall@gmail.com> --- Created attachment 43385 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43385&action=edit MARC21 File for testing -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 43386 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43386&action=edit Bug 14716 - opac-detail.pl -- Series link fails when series title ends with semicolon preceded by space. This is happening because the query is malformed. Take for example the query se,phr:"Frank%20Einstein%20;" which is se,phr:"Frank Einstein" but the semicolon is truncating the query so it looks to Koha se,phr:"Frank Einstein which is not a problem on the staff side. Zebra seems to deal with this ok. On the opac side though, we are adding on supression, so the query ends up like this: (se,phr:"Frank Einstein ) not Suppress=1 which zebra chokes on. Removing the semicolon from the subject heading would fix this, but I imagine that's a band-aid as the semi is part of the standard. The semi is being treated as an ampersand. This is deep in the machinery ( http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2 ) Basically, the semi needs to be url encoded as %3B Test Plan: 1) Import the records in the attached MARC21 file, re-index 2) From the OPAC search for "Frank Einstein and the antimatter motor" 3) Click the series link, note you get no results 4) Apply this patch 5) Refresh the record details page 6) Click the series link 7) Results! NOTE: This bug does not occurr with all Koha server configurations. I have yet to determine the specific variable that creates this truncation behavior. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43386|0 |1 is obsolete| | --- Comment #4 from Mason James <mtj@kohaaloha.com> --- Created attachment 43412 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43412&action=edit Bug 14716 - opac-detail.pl -- Series link fails when series title ends with semicolon preceded by space. This is happening because the query is malformed. Take for example the query se,phr:"Frank%20Einstein%20;" which is se,phr:"Frank Einstein" but the semicolon is truncating the query so it looks to Koha se,phr:"Frank Einstein which is not a problem on the staff side. Zebra seems to deal with this ok. On the opac side though, we are adding on supression, so the query ends up like this: (se,phr:"Frank Einstein ) not Suppress=1 which zebra chokes on. Removing the semicolon from the subject heading would fix this, but I imagine that's a band-aid as the semi is part of the standard. The semi is being treated as an ampersand. This is deep in the machinery ( http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2 ) Basically, the semi needs to be url encoded as %3B Test Plan: 1) Import the records in the attached MARC21 file, re-index 2) From the OPAC search for "Frank Einstein and the antimatter motor" 3) Click the series link, note you get no results 4) Apply this patch 5) Refresh the record details page 6) Click the series link 7) Results! NOTE: This bug does not occurr with all Koha server configurations. I have yet to determine the specific variable that creates this truncation behavior. Signed-off-by: Mason James <mtj@kohaaloha.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 --- Comment #5 from Mason James <mtj@kohaaloha.com> ---
Signed-off-by: Mason James <mtj@kohaaloha.com>
thanks Barton - patch works perfectly for me -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 --- Comment #6 from Mason James <mtj@kohaaloha.com> --- Created attachment 43413 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43413&action=edit Bug 14716 - opac-detail.pl -- Series link fails when series - [FOLLOWUP] correct 2 other problematic series links -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 --- Comment #7 from Mason James <mtj@kohaaloha.com> --- (In reply to Mason James from comment #6)
Created attachment 43413 [details] [review] Bug 14716 - opac-detail.pl -- Series link fails when series - [FOLLOWUP]
switching back to 'needs signoff' for followup patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13316 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43412|0 |1 is obsolete| | Attachment #43413|0 |1 is obsolete| | --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 44174 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44174&action=edit Bug 14716 - opac-detail.pl -- Series link fails when series title ends with semicolon preceded by space. This is happening because the query is malformed. Take for example the query se,phr:"Frank%20Einstein%20;" which is se,phr:"Frank Einstein" but the semicolon is truncating the query so it looks to Koha se,phr:"Frank Einstein which is not a problem on the staff side. Zebra seems to deal with this ok. On the opac side though, we are adding on supression, so the query ends up like this: (se,phr:"Frank Einstein ) not Suppress=1 which zebra chokes on. Removing the semicolon from the subject heading would fix this, but I imagine that's a band-aid as the semi is part of the standard. The semi is being treated as an ampersand. This is deep in the machinery ( http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2 ) Basically, the semi needs to be url encoded as %3B Test Plan: 1) Import the records in the attached MARC21 file, re-index 2) From the OPAC search for "Frank Einstein and the antimatter motor" 3) Click the series link, note you get no results 4) Apply this patch 5) Refresh the record details page 6) Click the series link 7) Results! NOTE: This bug does not occurr with all Koha server configurations. I have yet to determine the specific variable that creates this truncation behavior. Signed-off-by: Mason James <mtj@kohaaloha.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 44175 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44175&action=edit Bug 14716 - opac-detail.pl -- Series link fails when series - [FOLLOWUP] correct 2 other problematic series links Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hm, wondering - why not remove the semicolon from the search term as we do in other places? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Status|Signed Off |In Discussion -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 --- Comment #11 from Mason James <mtj@kohaaloha.com> --- (In reply to Katrin Fischer from comment #10)
Hm, wondering - why not remove the semicolon from the search term as we do in other places?
Hmmm... why remove characters from a search term, when you have a working solution that allows those characters to be used? I think this solution is better -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |murphy.daniel.j@edumail.vic | |.gov.au --- Comment #12 from Mason James <mtj@kohaaloha.com> --- (In reply to Katrin Fischer from comment #10)
Hm, wondering - why not remove the semicolon from the search term as we do in other places?
also, its not just the semicolon that is a problem character, its any character *other* than these... !'()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~ so, we would have to remove all other characters from all search terms, using that method its patch provides a general xslt solution to correctly encode problem characters within a url -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 --- Comment #13 from Mason James <mtj@kohaaloha.com> --- (In reply to Mason James from comment #11)
(In reply to Katrin Fischer from comment #10)
Hm, wondering - why not remove the semicolon from the search term as we do in other places?
Hmmm... why remove characters from a search term, when you have a working solution that allows those characters to be used?
I think this solution is better
Cait, its not just the semicolon character that is causing a problem, here afaict, its any char thats *not* the following... <!-- Characters that usually don't need to be escaped --> !'()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz- so, your solution would require us to remove all those problem chars from a 'search term', rather than using a technique that correctly url-encodes them all If you are happy with my explaination, please change the status back to signed-off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 --- Comment #14 from Mason James <mtj@kohaaloha.com> --- oops, double post (In reply to Mason James from comment #12)
(In reply to Katrin Fischer from comment #10)
Hm, wondering - why not remove the semicolon from the search term as we do in other places?
also, its not just the semicolon that is a problem character,
Cait, its not just the semicolon character that is causing a problem, here
oups, doubled posted :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44175|0 |1 is obsolete| | --- Comment #15 from Mason James <mtj@kohaaloha.com> --- Created attachment 45743 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45743&action=edit Bug 14716 - opac-detail.pl -- Series link fails when series - [FOLLOWUP] correct 2 other problematic series links Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Mason James <mtj@kohaaloha.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 --- Comment #16 from Mason James <mtj@kohaaloha.com> --- (In reply to Mason James from comment #7)
(In reply to Mason James from comment #6)
Created attachment 43413 [details] [review] [review] Bug 14716 - opac-detail.pl -- Series link fails when series - [FOLLOWUP]
switching back to 'needs signoff' for followup patch
follow-up patch is now 'signed-off' -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 --- Comment #17 from Mason James <mtj@kohaaloha.com> --- (In reply to Mason James from comment #13)
(In reply to Mason James from comment #11)
(In reply to Katrin Fischer from comment #10)
Hm, wondering - why not remove the semicolon from the search term as we do in other places?
If you are happy with my explanation, please change the status back to signed-off
waiting for a response from Cait here -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org