Bug 16483 - Ampersand breaks search for analytics
Summary: Ampersand breaks search for analytics
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-09 20:09 UTC by Magnus Enger
Modified: 2020-11-30 21:44 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2016-05-09 20:09:37 UTC
A customer has reported the following problem:

A journal is catalogued with separate records for each issue. The journal has an ampersand in the title, let's call it "This & that". Each issue has 245$a like "This & that 2011-1", "This & that 2011-2" and so on. For each issue, there are analytical records. 

Now, when you are on the detail view of one of the issues in the staff client (<intranet>/cgi-bin/koha/catalogue/detail.pl?biblionumber=12657) and click on "Show analytics", you get results from all issues of the journal, not just the one you wanted. The URL you are taken to looks like this:

<intranet>/cgi-bin/koha/catalogue/search.pl?q=Host-item:This & that 2011-3.

Above the search results it says:

14 result(s) found for 'Host-item:This ' in MyLibrary Catalog.

Note that the title has been cut before the ampersand. 

It is possible to tweak the search URL (remove the ampersand) and get the expected results. Changing the URL to this:

<intranet>/cgi-bin/koha/catalogue/search.pl?q=Host-item:This that 2011-3.

gives this:

8 result(s) found for 'Host-item:This that 2011-3.' in MyLibrary Catalog.

The same thing happens in the OPAC. 

I guess a workaround will be to enable UseControlNumber and follow the descriptions here: https://wiki.koha-community.org/wiki/Analytics
Comment 1 Katrin Fischer 2020-01-11 12:46:04 UTC
I believe this to be fixed with the use of str:encode-uri in the XSLT files now.