Bug 11446 - Authority not searching full corporate name with and (&) symbol
Summary: Authority not searching full corporate name with and (&) symbol
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Phil Ringnalda
QA Contact: Marcel de Rooy
URL:
Keywords:
: 25121 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-26 03:40 UTC by Iming Chan
Modified: 2020-05-22 14:28 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06, 19.05.11


Attachments
Screen image (2.85 MB, image/bmp)
2013-12-26 03:40 UTC, Iming Chan
Details
Screen image (2.85 MB, image/bmp)
2013-12-26 03:41 UTC, Iming Chan
Details
Bug 11446: Use encodeURIComponent on search terms in authority lookup plugin (3.38 KB, patch)
2020-04-24 20:06 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 11446: Use encodeURIComponent on search terms in authority lookup plugin (3.67 KB, patch)
2020-04-28 21:03 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 11446: Use encodeURIComponent on search terms in authority lookup plugin (3.77 KB, patch)
2020-05-15 09:29 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Iming Chan 2013-12-26 03:40:22 UTC
Created attachment 23813 [details]
Screen image

Authority plugin not searching corporate name (Marc 110/710) with 'and' (&) symbol.  It will only search corporate name prior to the symbol. 

For example:
Cement Concrete & Aggregates Australia

Authority plugin only shows:
Cement Concrete
Comment 1 Iming Chan 2013-12-26 03:41:34 UTC
Created attachment 23814 [details]
Screen image
Comment 2 Katrin Fischer 2014-11-03 22:23:21 UTC
To test:
- Create an authority for "Cement Concrete & Aggregates Australia"
- Create a new bibliographic record, link to the authority
- Click on the plugin again, the search string is not complete
Comment 3 Marjorie Barry-Vila 2017-10-12 15:21:56 UTC
Still valid in 16.05 with uniform title too.

Regards
Marjorie
Comment 4 Katrin Fischer 2020-01-05 11:52:01 UTC
Still valid.
Comment 5 Phil Ringnalda 2020-04-14 16:23:21 UTC
*** Bug 25121 has been marked as a duplicate of this bug. ***
Comment 6 Phil Ringnalda 2020-04-24 20:06:49 UTC
Created attachment 103707 [details] [review]
Bug 11446: Use encodeURIComponent on search terms in authority lookup plugin

While adding the data from the existing field to the auth_finder URI,
we're using encodeURI(), which is meant for an entire URI and thus
doesn't escape &. Things that are going into a querystring need
encodeURIComponent() instead.

Test plan:

1. Enable the system preference EnableAdvancedCatalogingEditor
2. Clear your browser cache, even a shift+reload won't get you a fresh
marc-editor.js for the advanced editor
3. Create a Topical Term authority with 150 $aThis & That$xStuff & Junk
4. In the Basic editor, use the authority plugin on the 650 field to
select that authority.
5. Click the authority plugin again, verify that the popup contains This
& That and Stuff & Junk rather than just This and Stuff
6. From the Cataloging home page choose Advanced editor
7. In a new line paste 650 _ _ ‡aThis & That‡xStuff & Junk
8. Type ctrl+shift+L and verify the popup shows both words in both
fields
Comment 7 Phil Ringnalda 2020-04-25 14:41:34 UTC
9. When you remember the plugin exists there too, edit your Stuff & Junk authority, and in a 550 tag type One & Two in $a and Three & Four in $x and click the plugin link, verify that the search window has your search terms not cut off.
Comment 8 Katrin Fischer 2020-04-28 21:03:45 UTC
Created attachment 103886 [details] [review]
Bug 11446: Use encodeURIComponent on search terms in authority lookup plugin

While adding the data from the existing field to the auth_finder URI,
we're using encodeURI(), which is meant for an entire URI and thus
doesn't escape &. Things that are going into a querystring need
encodeURIComponent() instead.

Test plan:

1. Enable the system preference EnableAdvancedCatalogingEditor
2. Clear your browser cache, even a shift+reload won't get you a fresh
marc-editor.js for the advanced editor
3. Create a Topical Term authority with 150 $aThis & That$xStuff & Junk
4. In the Basic editor, use the authority plugin on the 650 field to
select that authority.
5. Click the authority plugin again, verify that the popup contains This
& That and Stuff & Junk rather than just This and Stuff
6. From the Cataloging home page choose Advanced editor
7. In a new line paste 650 _ _ ‡aThis & That‡xStuff & Junk
8. Type ctrl+shift+L and verify the popup shows both words in both
fields
9. When you remember the plugin exists there too, edit your
Stuff & Junk authority, and in a 550 tag type One & Two in
$a and Three & Four in $x and click the plugin link, verify that
the search window has your search terms not cut off.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Katrin Fischer 2020-04-28 21:04:45 UTC
Thx Phil for taking on this old and annoying bug!

I have added (and tested) your step 9 to the commit message and found another bug while testing:

Bug 25308 - When cataloguing search fields are prefilled form record, content after & is cut off
Comment 10 Marcel de Rooy 2020-05-15 09:29:34 UTC
Created attachment 104924 [details] [review]
Bug 11446: Use encodeURIComponent on search terms in authority lookup plugin

While adding the data from the existing field to the auth_finder URI,
we're using encodeURI(), which is meant for an entire URI and thus
doesn't escape &. Things that are going into a querystring need
encodeURIComponent() instead.

Test plan:

1. Enable the system preference EnableAdvancedCatalogingEditor
2. Clear your browser cache, even a shift+reload won't get you a fresh
marc-editor.js for the advanced editor
3. Create a Topical Term authority with 150 $aThis & That$xStuff & Junk
4. In the Basic editor, use the authority plugin on the 650 field to
select that authority.
5. Click the authority plugin again, verify that the popup contains This
& That and Stuff & Junk rather than just This and Stuff
6. From the Cataloging home page choose Advanced editor
7. In a new line paste 650 _ _ ‡aThis & That‡xStuff & Junk
8. Type ctrl+shift+L and verify the popup shows both words in both
fields
9. When you remember the plugin exists there too, edit your
Stuff & Junk authority, and in a 550 tag type One & Two in
$a and Three & Four in $x and click the plugin link, verify that
the search window has your search terms not cut off.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 11 Martin Renvoize 2020-05-18 14:29:01 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 12 Joy Nelson 2020-05-19 23:05:09 UTC
backported to 19.11.x for 19.11.06
Comment 13 Lucas Gass 2020-05-22 14:28:09 UTC
backported to 19.05.x for 19.05.11