Bug 5693 - if parentheses used in ccode then searches against ccode fail
Summary: if parentheses used in ccode then searches against ccode fail
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: unspecified
Hardware: All All
: PATCH-Sent (DO NOT USE) normal (vote)
Target Milestone: ---
Assignee: Reed Wade
QA Contact: Bugs List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-04 03:11 UTC by Reed Wade
Modified: 2019-02-15 01:09 UTC (History)
4 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
patch to wrap mc-ccode search limit in quotes (1.16 KB, patch)
2011-02-04 03:29 UTC, Reed Wade
Details | Diff | Splinter Review
Follow up fix (15.95 KB, patch)
2011-03-14 20:43 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Reed Wade 2011-02-04 03:11:19 UTC
If you set a CCODE value which contains parentheses like "S(B)" then when you search against it the parentheses confuse the search query parser per:

opac-search.pl: WARNING: query problem with  (mc-ccode=S(B)) ZOOM error 10014 "CCL parsing error" (addinfo: "')' expected") from diag-set 'ZOOM' at /home/reed/Catalyst/koha/koha/C4/Search.pm line 346.

Patch provide wraps the mc-ccode value in quotes to get around this.
Comment 1 Reed Wade 2011-02-04 03:29:48 UTC
Created attachment 3065 [details] [review]
patch to wrap mc-ccode search limit in quotes
Comment 2 Reed Wade 2011-02-04 03:30:33 UTC
Work is sponsored by Opus
Comment 3 MJ Ray (software.coop) 2011-03-03 08:36:58 UTC
This bug is mentioned in:
bug 5693 - mc-ccode parens fix http://lists.koha-community.org/pipermail/koha-patches/2011-February/013766.html
Comment 4 Chris Cormack 2011-03-05 19:36:43 UTC
Pushed, please test and mark resolved
Comment 5 Chris Cormack 2011-03-14 20:28:53 UTC
This now ends up with a url like this

a href="/cgi-bin/koha/opac-search.pl?idx=kw&q=a&limit=mc-ccode:"AF"&amp;sort_by=relevance&amp;limit=su-geo:Alabama." title="Alabama.">Alabama.</a> 

With the "AF" breaking it obviously, working on a follow up patch to escape the html where limit_cgi is used in the templates
Comment 6 Chris Cormack 2011-03-14 20:42:16 UTC
Follow up patch submitted
Comment 7 Chris Cormack 2011-03-14 20:43:45 UTC
Created attachment 3296 [details] [review]
Follow up fix
Comment 8 Chris Cormack 2011-03-14 21:05:09 UTC
Follow up patch pushed, please test and mark resolved
Comment 9 MJ Ray (software.coop) 2011-04-06 13:51:40 UTC
This bug is mentioned in:
bug 5693 - mc-ccode parens fix http://lists.koha-community.org/pipermail/koha-patches/2011-March/013985.html
Bug 5693 : Follow up patch,	escaping HTML in limit_cgi so &quot;&quot; dont break hrefs http://lists.koha-community.org/pipermail/koha-patches/2011-March/014046.html
Bug 5693 : Follow up patch,	escaping HTML in limit_cgi so &quot;&quot; dont break hrefs http://lists.koha-community.org/pipermail/koha-patches/2011-March/014048.html