Bug 15468

Summary: Search links on callnumbers with parentheses fails on OPAC results page
Product: Koha Reporter: Jef Bucas <jefkoha>
Component: SearchingAssignee: Chloe Alabaster <chloealabaster>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: brendan, chris, f.demians, julian.maurice
Version: MainKeywords: Academy
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 15468 - Search links on callnumber fails on opac results page
[SIGNED-OFF] Bug 15468 - Search links on callnumbers with parentheses fails on OPAC results page
[PASSED QA] Bug 15468 - Search links on callnumbers with parentheses fails on OPAC results page

Description Jef Bucas 2016-01-05 10:36:39 UTC
Similar to Bug 12405, but for the OPAC.

Freshly migrated from Heritage to Koha: https://library.celt.dias.ie

If a call number contains "(" or ")", the "q=callnum" query doesn't work in the Debian packaged version 3.22

Example:
https://library.celt.dias.ie/cgi-bin/koha/opac-search.pl?q=callnum:891.6205%20ITS%20(43iii)

Solution is similar to Bug 12405, is to introduce %22 into the search query
https://library.celt.dias.ie/cgi-bin/koha/opac-search.pl?q=callnum:%22891.6205%20ITS%20(43iii)%22


This can be done by changing:

/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/en/modules/opac-results.tt on line 405:
[% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:%22[% available_items_loo.itemcallnumber |url %]%22">[% available_items_loo.itemcallnumber %]</a>][% END %]
Comment 1 Chloe Alabaster 2016-01-19 03:16:21 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2016-01-19 15:44:17 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2016-01-19 22:59:20 UTC
Created attachment 46957 [details] [review]
[PASSED QA] Bug 15468 - Search links on callnumbers with parentheses fails on OPAC results page

To Test:
1-before plugin search in opac for a call number with either a "(" or a ")" in it
2-it should come back with no results
3-use plugin
4-re-search the call number with "(" or ")"
5-the search should come back with results

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
It seems this only works with OPAC XSLT for results page turned off
and OPACItemsResultsDisplay turned on. - Then the callnumbers
in the result list will be linked for searching.
Comment 4 Brendan Gallagher 2016-01-27 03:35:32 UTC
Pushed to master - Should be in the May 2016 release.  Thanks!
Comment 5 Julian Maurice 2016-01-29 14:46:18 UTC
Patch pushed to 3.22.x, will be in 3.22.3
Comment 6 Frédéric Demians 2016-02-12 06:41:54 UTC
This patch has been pushed to 3.20.x, will be in 3.20.9.