Bug 26605 - Correctly URI-encode query string in call number browse plugin
Summary: Correctly URI-encode query string in call number browse plugin
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Phil Ringnalda
QA Contact: Testopia
URL:
Keywords:
Depends on: 13364
Blocks:
  Show dependency treegraph
 
Reported: 2020-10-02 21:50 UTC by Phil Ringnalda
Modified: 2020-11-17 13:08 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.06, 19.11.12


Attachments
Bug 26605: Correctly URI-encode query string in call number browse plugin (2.01 KB, patch)
2020-10-02 22:09 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 26605: Correctly URI-encode query string in call number browse plugin (2.07 KB, patch)
2020-10-25 21:07 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 26605: Correctly URI-encode query string in call number browse plugin (2.12 KB, patch)
2020-11-01 13:16 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 Phil Ringnalda 2020-10-02 21:50:35 UTC
If you search for a call number like "M KRUEGER CO #11" in the cn_browser.pl plugin, your query is cut off at "M KRUEGER CO " because the hash isn't escaped, so the browser thinks you are opening a window and trying to navigate to the element with the id 11 rather than passing the #11 to the server.
Comment 1 Phil Ringnalda 2020-10-02 22:09:05 UTC
Created attachment 111183 [details] [review]
Bug 26605: Correctly URI-encode query string in call number browse plugin

If you search for a call number like "M KRUEGER CO #11" in the
cn_browser.pl plugin, your query is cut off at "M KRUEGER CO " because
the hash isn't escaped, so the browser thinks you are opening a
window and trying to navigate to the element with the id 11 rather
than passing the #11 to the server.

To test:
1) Find the record you will use to test, determing the MARC
framework it uses by going to Edit > Edit record > Settings
2) In Administration > MARC bibliographic framework, click MARC
structure in the Actions menu for that framework
3) Navigate to the 952 tag, in the Actions menu click Edit subfields
4) In the tab for o, choose the Plugin cn_browser.pl and click
Save Changes
5) Click the Edit button next to one of the items on your record
6) In the Full call number field, add " CO #11" to the call number
7) Click the ... next to the field to open the Tag editor
8) In the popup window, verify that the search field includes the
" CO #11" you added to the call number
Comment 2 Chris Cormack 2020-10-25 21:07:47 UTC
Created attachment 112486 [details] [review]
Bug 26605: Correctly URI-encode query string in call number browse plugin

If you search for a call number like "M KRUEGER CO #11" in the
cn_browser.pl plugin, your query is cut off at "M KRUEGER CO " because
the hash isn't escaped, so the browser thinks you are opening a
window and trying to navigate to the element with the id 11 rather
than passing the #11 to the server.

To test:
1) Find the record you will use to test, determing the MARC
framework it uses by going to Edit > Edit record > Settings
2) In Administration > MARC bibliographic framework, click MARC
structure in the Actions menu for that framework
3) Navigate to the 952 tag, in the Actions menu click Edit subfields
4) In the tab for o, choose the Plugin cn_browser.pl and click
Save Changes
5) Click the Edit button next to one of the items on your record
6) In the Full call number field, add " CO #11" to the call number
7) Click the ... next to the field to open the Tag editor
8) In the popup window, verify that the search field includes the
" CO #11" you added to the call number

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 3 Katrin Fischer 2020-11-01 13:16:12 UTC
Created attachment 112803 [details] [review]
Bug 26605: Correctly URI-encode query string in call number browse plugin

If you search for a call number like "M KRUEGER CO #11" in the
cn_browser.pl plugin, your query is cut off at "M KRUEGER CO " because
the hash isn't escaped, so the browser thinks you are opening a
window and trying to navigate to the element with the id 11 rather
than passing the #11 to the server.

To test:
1) Find the record you will use to test, determing the MARC
framework it uses by going to Edit > Edit record > Settings
2) In Administration > MARC bibliographic framework, click MARC
structure in the Actions menu for that framework
3) Navigate to the 952 tag, in the Actions menu click Edit subfields
4) In the tab for o, choose the Plugin cn_browser.pl and click
Save Changes
5) Click the Edit button next to one of the items on your record
6) In the Full call number field, add " CO #11" to the call number
7) Click the ... next to the field to open the Tag editor
8) In the popup window, verify that the search field includes the
" CO #11" you added to the call number

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2020-11-02 10:05:36 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 5 Lucas Gass 2020-11-16 18:45:06 UTC
backported to 20.05.x for 20.05.06
Comment 6 Aleisha Amohia 2020-11-17 05:16:24 UTC
backported to 19.11.x for 19.11.12
Comment 7 Victor Grousset/tuxayo 2020-11-17 13:08:31 UTC
Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed.