Bug 12405 - Search links on callnumber fails on intranet results page
Summary: Search links on callnumber fails on intranet results page
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
: 12894 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-06-11 10:24 UTC by Fridolin Somers
Modified: 2016-06-21 21:37 UTC (History)
5 users (show)

See Also:
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 12405 - Search links on callnumber fails on intranet results page (7.46 KB, patch)
2014-06-11 10:35 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 12405 - Search links on callnumber fails on intranet results page (7.67 KB, patch)
2014-09-10 04:07 UTC, Liz Rea
Details | Diff | Splinter Review
[PASSED QA] Bug 12405 - Search links on callnumber fails on intranet results page (7.81 KB, patch)
2014-09-10 21:22 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2014-06-11 10:24:48 UTC
On intranet results page, the callnumber of items is a search like : 
/cgi-bin/koha/catalogue/search.pl?idx=callnum&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.
Comment 1 Fridolin Somers 2014-06-11 10:35:00 UTC Comment hidden (obsolete)
Comment 2 Nicole C. Engard 2014-06-18 20:44:38 UTC
I'm not sure I'm following the test plan right, but I have queryweightfields off and when i click the call number that starts with a & I get brought to the advanced search page and when i click the one with the parens and AND OR in it I get no results found - both of these after applying the patch.
Comment 3 David Cook 2014-06-19 06:13:27 UTC
I'll take a look at this one later...
Comment 4 Liz Rea 2014-09-10 04:07:22 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2014-09-10 21:14:11 UTC
*** Bug 12894 has been marked as a duplicate of this bug. ***
Comment 6 Katrin Fischer 2014-09-10 21:22:06 UTC
Created attachment 31516 [details] [review]
[PASSED QA] 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&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.
Comment 7 Tomás Cohen Arazi (tcohen) 2014-09-18 13:11:18 UTC
Patch pushed to master.

Thanks Fridolin!
Comment 8 Galen Charlton 2014-09-23 20:58:00 UTC
Pushed to 3.16.x for inclusion in 3.16.4.
Comment 9 Fridolin Somers 2014-12-12 08:50:56 UTC
Pushed to 3.14.x, will be in 3.14.12.