Bug 12405 - Search links on callnumber fails on intranet results page
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 11 Jun 2014 10:25:19 +0000 (12:25 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 12 Dec 2014 08:49:09 +0000 (09:49 +0100)
commit1caaf4e24ba99541df1b8feeb9fdeb759c6ab2c6
treec1435da83289a1106a3e5838b7e179dc503832fb
parentb660177cc5472f753ae7af360ac0c8e707ade6c8
Bug 12405 - Search links on callnumber fails on intranet results page

On intranet results page, the callnumber of items is a search like :
/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=[% result.itemcallnumber |url %]

The callnumber should be URI-escaped to avoid special URI characters like & , ? ...
If the callnumber contains some CCL words or parenthesis, the search will fail, it should be wrapped with double-quotes.

This patch adds this to catalogue/results.pl and catalogue/shelves.pl :
- uri TT filter instead of url
- adds double-quotes using there URI code %22 since its in a HTML attribute using double-quotes

Test plan :
- Edit an item callnumber with : & ABC 123
- Index zebraqueue
- Perform a search returning this item
- Click on the callnumber
=> Without this patch you get no result, because URL parameters are : idx=callnum&q=& ABC 123
=> With this patch you get results
- Set syspref QueryWeightFields off (because this is no bug if on)
- Edit an item callnumber with : AB(C) AND OR
- Index zebraqueue
- Perform a search returning this item
- Click on the callnumber
=> Without this patch you get no result, because the search contains CCL words "OR" and "AND"
=> With this patch you get results

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Tested all with and without queryweightfields -
all searches from clicked call numbers for given callnumbers fail without the patch, all are successful with the patch.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described - no problems found.
Passes tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 05ace0b38085a11fbdd7c031a8a251243544b564)
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt