[Bug 16804] New: Searching can be broken by search terms containing semicolons in XSLT
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Bug ID: 16804 Summary: Searching can be broken by search terms containing semicolons in XSLT Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Searching Assignee: gmcharlt@gmail.com Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org As of CGI version 2.64 ( which was a long time again ) Perl's CGI module began supporting the use of the semicolon (;) as a key value pair separator in addition to the ampersand (&) which Koha currently uses. This causes an issue where is search string is truncated at the semicolon. Not only can this cause issues with incorrect searches/results, it can cause malformed CCL which causes Koha to return no search results! Test Plan: 1) Create a record with a 490$a series statement where there is a semicolon at the end 2) Enable OPAC Suppression 3) Search for the record and click the "Series:" link 4) You will get no results This is because the search: se,phr:"Report to the Mississippi Legislature ;" is converted to se,phr:"Report to the Mississippi Legislature When the opac suppression is tacked on, we get malformed CCL: (se,phr="Report to the Mississippi Legislature ) not Suppress=1 This is not an issue if we simply search for se,phr:"Report to the Mississippi Legislature ;" because the search form properly encodes the semicolon. The solution appears to be to make sure all URL elements are properly url encoded and converts all ";" to "%3B". I do notice that in koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils-MODS31.xsl we have a template url-encode that may prove useful. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Liz Rea <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=17875 CC| |liz@catalyst.net.nz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Liz Rea <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |In Discussion --- Comment #1 from Liz Rea <liz@catalyst.net.nz> --- Hi Kyle, Using the MODS url-encode works when you transfer it over to slimUtils, is that what you had in mind or something else? Seems like it sorts the problem nicely. Cheers, Liz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Liz Rea <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 --- Comment #2 from Liz Rea <liz@catalyst.net.nz> --- Created attachment 67622 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67622&action=edit Bug 16804 - unescaped semicolons in XSLT values can cause searches to fail This patch adds a url-encode to the MARC21slimUtils, and applies it specifically to a common place where semicolons can appear in searches, the 490 field. To test: * have OPACSuppression on * have a record with a 490 field a la: 490 _a something ; _v 123 * go to the opac and search for this record * click the Series link from the detail Without this patch, there will be no results. With this patch, you will get relevant results (possibly the same record back) There are probably lots of places this could be applied, and also possibly many other solutions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Liz, I think we had a similar approach on another bug, but when I tested with Japanese text the links were totally broken. Could you test your patch with some original script in 490? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I've used some Japanese signs in 490 for testing: 日本日本日本;;; The link is broken: http://localhost:8080/cgi-bin/koha/opac-search.pl?q=se,phr:%22%3F%3F%3F%3F%3... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think an easier solution would be to just remove ; for now as this is the most common problem case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |liz@catalyst.net.nz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Liz Rea <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 --- Comment #6 from Liz Rea <liz@catalyst.net.nz> --- Created attachment 70241 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70241&action=edit Bug 16804 - semicolons break series search in 490 To test: * have OPACSuppression on * have a record with a 490 field a la: 490 _a something ; _v 123 * go to the opac and search for this record * click the Series link from the detail Without this patch, there will be no results. With this patch, you will get relevant results (possibly the same record back) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Liz Rea <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #7 from Liz Rea <liz@catalyst.net.nz> --- Hi Katrin, I put a chopPunctuation on the href attribute, it'll chop of whatever ending punctuation people feel inclined to put there. What do you think? Cheers, Liz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Liz Rea <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #67622|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 --- Comment #8 from Liz Rea <liz@catalyst.net.nz> --- well not *any*, specifically these: .:,;/ ' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Liz Rea <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #70241|0 |1 is obsolete| | --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 76064 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76064&action=edit Bug 16804 - semicolons break series search in 490 To test: * have OPACSuppression on * have a record with a 490 field a la: 490 _a something ; _v 123 * go to the opac and search for this record * click the Series link from the detail Without this patch, there will be no results. With this patch, you will get relevant results (possibly the same record back) Signed-off-by: Joy Nelson <joy@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=14716 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Why "* have OPACSuppression on"? Would like to test if bug 14716 also resolves the issue - might be the nicer global fix. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 --- Comment #11 from Joy Nelson <joy@bywatersolutions.com> --- Katrin, I did a retest to confirm. This patch will fix if opac suppress if ON or OFF. joy (In reply to Katrin Fischer from comment #10)
Why "* have OPACSuppression on"?
Would like to test if bug 14716 also resolves the issue - might be the nicer global fix.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I feel bug 18304 could be the better solution here. I tested it also fixes the issue. Linking both bugs for now using 'see also'. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 --- Comment #13 from Joy Nelson <joy@bywatersolutions.com> --- Can you verify the bug number Katrin? 18304 is an email issue. (In reply to Katrin Fischer from comment #12)
I feel bug 18304 could be the better solution here. I tested it also fixes the issue. Linking both bugs for now using 'see also'.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Sorry, too late here: bug 14716 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 --- Comment #15 from Liz Rea <liz@catalyst.net.nz> --- That's funny, my original solution was basically that url-encode one. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Not quite, this is using an exslt function that can do more than the self implemented url-encode that was tried before. Especially original script like Hebrew and Chinese. Try adding a subject 日本 (Japan) in 653. It will work with the new solution, but not with the last one. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Liz Rea <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|liz@catalyst.net.nz |koha-bugs@lists.koha-commun | |ity.org -- 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=16804 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Status|Signed Off |In Discussion --- Comment #17 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Moving this to In Discussion. Leaving it in SO is confusing. We seem to wait for progress on 14716. -- 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=16804 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |liz@catalyst.net.nz |ity.org | -- 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=16804 Margaret <margaret@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |margaret@bywatersolutions.c | |om -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16804 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |RESOLVED Resolution|--- |DUPLICATE --- Comment #18 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Marking resolved fixed as the url-encoding with the exslt function now solves this nicely. *** This bug has been marked as a duplicate of bug 14716 *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org