Bug 13301

Summary: Call number link in search results is broken
Product: Koha Reporter: Barton Chittenden <barton>
Component: SearchingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED WORKSFORME QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: katrin.fischer, tomascohen
Version: 3.16   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Screenshot of link in search results.
Marcxml for John Grisham's "The chamber"

Description Barton Chittenden 2014-11-19 19:15:57 UTC
Created attachment 33691 [details]
Screenshot of link in search results.

The call number link in the Location column for search results returns no results when the call number is entirely alphabetic.

For example, if I do a keyword search for

 grisham

I get a series of search results for titles by John Grisham.

In the location column, I see

1 item, 1 available:
My Library Here [FIC GRI] (1) 
BOOK

Where [FIC GRI] is a link. When I click on the link, I get

No results found
No results match your search for 'callnum,wrdl: "FIC GRI"' in 
My Library Here

What I'm seeing is that the URL under the callnumber link is

http://.../cgi-bin/koha/catalogue/search.pl?idx=callnum&q="FIC%20GRI"

When I remove the quotes, the search will work.

[See the attached screenshot; there is a red arrow pointing to the link in question].
Comment 1 Barton Chittenden 2014-11-19 19:23:39 UTC
Created attachment 33692 [details]
Marcxml for John Grisham's "The chamber"

Import this record as an example for replicating the problem.
Comment 2 Barton Chittenden 2014-11-19 19:32:43 UTC
I have seen this problem on two 3.16.04 sites, but the problem does *not* appear on the bywater solutions demo site, which is running 3.17

Setup:
1) Download the Marcxml attachment.
2) Stage the record
3) Import the record
4) Add an item for the record
5) Wait for zebra to index the record

To replicate the problem:
1) Do a keyword search for 'Grisham'
2) The search results will show 'The testament', with a link under the text 'FIC GRI'.
3) Clicking on this link will show no results.
Comment 3 Katrin Fischer 2014-11-23 10:50:33 UTC
One difference could be the type of indexing (GRS1, DOM) or using/not using QP.
Comment 4 Barton Chittenden 2014-12-31 20:25:49 UTC
(In reply to Katrin Fischer from comment #3)
> One difference could be the type of indexing (GRS1, DOM) or using/not using
> QP.

No, both sites are using DOM, and neither is using QP.
Comment 5 Katrin Fischer 2015-01-18 16:04:33 UTC
Hm, could you check ICU vs. CHR? I think that might be it.
Comment 6 Barton Chittenden 2015-01-20 16:07:06 UTC
(In reply to Katrin Fischer from comment #5)
> Hm, could you check ICU vs. CHR? I think that might be it.

The 'UseICU' system preference is set to 'Using'.
Comment 7 Katrin Fischer 2015-01-20 19:23:04 UTC
Hm, in both the working and non-working installation? And are they both actually using ICU? The pref influences how some search links work in the XSLT (afaik) but will not actually turn it off or on)
Comment 8 Owen Leonard 2016-06-21 16:56:22 UTC
Can this bug be reproduced in versions newer than 3.18.x? If so, please update the report's version information. If not, please close.
Comment 9 Barton Chittenden 2016-06-23 11:39:46 UTC
(In reply to Owen Leonard from comment #8)
> Can this bug be reproduced in versions newer than 3.18.x? If so, please
> update the report's version information. If not, please close.

I just tested this at the library that reported the issue; they're still seeing the problem under 3.22.07. I'll dig back through the templates and through the code and see if I can't find out what's triggering the behavior in question.
Comment 10 Barton Chittenden 2016-06-23 14:29:32 UTC
(In reply to Barton Chittenden from comment #9)
> (In reply to Owen Leonard from comment #8)
> > Can this bug be reproduced in versions newer than 3.18.x? If so, please
> > update the report's version information. If not, please close.
> 
> I just tested this at the library that reported the issue; they're still
> seeing the problem under 3.22.07. I'll dig back through the templates and
> through the code and see if I can't find out what's triggering the behavior
> in question.

I was able to re-create the symptoms on the library's server which is running 3.22.07. At the time that I filed the bug, the surrounding quotes weren't being url-encoded -- the link looked like this:

[<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q="FIC%20Grisham"">FIC Grisham</a>]

Which is obviously broken.

Now it looks like this:

[<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22FIC%20Grisham%22">FIC Grisham</a>]

That returns results on my test server running master (currently 16.06.00.002), but not on the library's server. I suspect that there are some configuration issues with zebra.

I'm going to go ahead and close this bug; if I find issues specific to the libraries configuration, I'll file a cleaner and more detailed bug report.