Bug 5693

Summary: if parentheses used in ccode then searches against ccode fail
Product: Koha Reporter: Reed Wade <reed>
Component: SearchingAssignee: Reed Wade <reed>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: normal    
Priority: PATCH-Sent (DO NOT USE) CC: chris, julian.maurice, jwagner, nengard
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22344
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: patch to wrap mc-ccode search limit in quotes
Follow up fix

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