Summary: | Searching can be broken by search terms containing semicolons in XSLT | ||
---|---|---|---|
Product: | Koha | Reporter: | Kyle M Hall (khall) <kyle> |
Component: | Searching | Assignee: | Liz Rea <liz> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | 1joynelson, liz, m.de.rooy, margaret |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17875 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14716 |
||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 16804 - unescaped semicolons in XSLT values can cause searches to fail
Bug 16804 - semicolons break series search in 490 Bug 16804 - semicolons break series search in 490 |
Description
Kyle M Hall (khall)
2016-06-23 16:36:54 UTC
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 Created attachment 67622 [details] [review] 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. 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? 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%3F%3F%3B%3B%3B%22 I think an easier solution would be to just remove ; for now as this is the most common problem case. Created attachment 70241 [details] [review] 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) 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 well not *any*, specifically these: .:,;/ ' Created attachment 76064 [details] [review] 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> Why "* have OPACSuppression on"? Would like to test if bug 14716 also resolves the issue - might be the nicer global fix. 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. 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'. 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'. Sorry, too late here: bug 14716 That's funny, my original solution was basically that url-encode one. 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. Moving this to In Discussion. Leaving it in SO is confusing. We seem to wait for progress on 14716. 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 *** |