Bug 28159 - URI-encode existing values put into query string for z39.50 authority search
Summary: URI-encode existing values put into query string for z39.50 authority search
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Authority data support (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Phil Ringnalda
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-16 16:33 UTC by Phil Ringnalda
Modified: 2021-12-13 21:10 UTC (History)
3 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:
21.05.00,20.11.06,20.05.12


Attachments
Bug 28159: URI-encode existing values put into query string for z39.50 authority search (1.59 KB, patch)
2021-04-16 17:06 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 28159: URI-encode existing values put into query string for z39.50 authority search (1.65 KB, patch)
2021-04-21 13:39 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28159: URI-encode existing values put into query string for z39.50 authority search (1.70 KB, patch)
2021-05-07 18:38 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Ringnalda 2021-04-16 16:33:54 UTC
If you have a Corporate Name authority record with 100$a containing Arthur Andersen & Co. and you click the Replace record via Z39.50/SRU search button, the Author (corporate) search field in the popup window is filled with "Arthur Andersen " because the unescaped & is treated as the start of the next query param.
Comment 1 Phil Ringnalda 2021-04-16 17:06:10 UTC
Created attachment 119768 [details] [review]
Bug 28159: URI-encode existing values put into query string for z39.50 authority search

When you trigger a z39.50 search from an existing authority record, Koha
prefills the search form with the value in the record. But because that
value passes through a URL, if it isn't URI-encoded characters like & or ;
will cut off the value.

Test plan:
1) Authorities - New authority - Corporate Name
2) Tab 1, click "HEADING-CORPORATE NAME" to expand subfields
3) Subfield a, type foo & bar ; baz
4) Click Z39.50/SRU search
5) Ensure the whole string appears in the Author (corporate) field in
   the popup
Comment 2 Owen Leonard 2021-04-21 13:39:44 UTC
Created attachment 119949 [details] [review]
Bug 28159: URI-encode existing values put into query string for z39.50 authority search

When you trigger a z39.50 search from an existing authority record,
Koha prefills the search form with the value in the record. But because
that value passes through a URL, if it isn't URI-encoded characters like
& or ; will cut off the value.

Test plan:
1) Authorities - New authority - Corporate Name
2) Tab 1, click "HEADING-CORPORATE NAME" to expand subfields
3) Subfield a, type foo & bar ; baz
4) Click Z39.50/SRU search
5) Ensure the whole string appears in the Author (corporate) field in
   the popup

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Nick Clemens 2021-05-07 18:38:58 UTC
Created attachment 120713 [details] [review]
Bug 28159: URI-encode existing values put into query string for z39.50 authority search

When you trigger a z39.50 search from an existing authority record,
Koha prefills the search form with the value in the record. But because
that value passes through a URL, if it isn't URI-encoded characters like
& or ; will cut off the value.

Test plan:
1) Authorities - New authority - Corporate Name
2) Tab 1, click "HEADING-CORPORATE NAME" to expand subfields
3) Subfield a, type foo & bar ; baz
4) Click Z39.50/SRU search
5) Ensure the whole string appears in the Author (corporate) field in
   the popup

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Jonathan Druart 2021-05-10 14:18:39 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 5 Fridolin Somers 2021-05-12 14:53:30 UTC
Pushed to 20.11.x for 20.11.06
Comment 6 Andrew Fuerste-Henry 2021-05-25 13:12:52 UTC
Pushed to 20.05.x for 20.05.12
Comment 7 Victor Grousset/tuxayo 2021-05-25 14:39:20 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.