Bug 24286 - FindDuplicateAuthority does not escape forward slash in 'GENRE/FORM'
Summary: FindDuplicateAuthority does not escape forward slash in 'GENRE/FORM'
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Nick Clemens
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-20 13:33 UTC by Nick Clemens
Modified: 2021-06-14 21:29 UTC (History)
5 users (show)

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


Attachments
Bug 24286: Escape forward slash in GENRE/FORM (and any authtype) (1.60 KB, patch)
2019-12-20 13:38 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24286: Escape forward slash in GENRE/FORM (and any authtype) (1.59 KB, patch)
2020-01-02 18:29 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24286: Escape forward slash in GENRE/FORM (and any authtype) (1.66 KB, patch)
2020-01-17 16:06 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24286: Escape forward slash in GENRE/FORM (and any authtype) (1.73 KB, patch)
2020-01-18 21:04 UTC, Myka Kennedy Stephens
Details | Diff | Splinter Review
Bug 24286: Escape forward slash in GENRE/FORM (and any authtype) (1.80 KB, patch)
2020-01-21 15:19 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2019-12-20 13:33:23 UTC
To recreate:
0 - Set SearchEngine to Elasticsearch,  QueryRegexEscapeOptions  to 'Don't Escape'
1 - Browse to Authorities
2 - Select New->New from Z3950
3 - Search for subject 'Short stories'
4 - Auth search explodes
Comment 1 Nick Clemens 2019-12-20 13:38:28 UTC
Created attachment 96524 [details] [review]
Bug 24286: Escape forward slash in GENRE/FORM (and any authtype)

Note that bug 24267 will fix the issue during Z39 searching for new auth, but the duplicate check at saving will still fail

To test:
 0 - Set SearchEngine to Elasticsearch,  QueryRegexEscapeOptions  to 'Don't Escape'
 1 - Browse to Authorities
 2 - Select New->New from Z3950
 3 - Search for subject 'Short stories'
 4 - Auth search explodes
 5 - Apply patch
 6 - Repeat and confirm the search results return
 7 - Import and save the GENRE/FORM record for Short stories
 8 - Repeat the search and import the same record
 9 - Confirm that upon save you are notified of duplicate, don't save
10 - set  QueryRegexEscapeOptions to 'Escape' and confirm Z39 searching works and importing/save notifies of duplicate
11 - set SearchEngine to Zebra and confirm Z39 searching works and importing/save notifies of duplicate
Comment 2 Jonathan Druart 2020-01-02 14:52:03 UTC
Please replace
  s/\//\\\//
with
  s#/#\\/#
to make it a bit more readable.
Comment 3 Nick Clemens 2020-01-02 18:29:24 UTC
Created attachment 96765 [details] [review]
Bug 24286: Escape forward slash in GENRE/FORM (and any authtype)

Note that bug 24267 will fix the issue during Z39 searching for new auth, but the duplicate check at saving will still fail

To test:
 0 - Set SearchEngine to Elasticsearch,  QueryRegexEscapeOptions  to 'Don't Escape'
 1 - Browse to Authorities
 2 - Select New->New from Z3950
 3 - Search for subject 'Short stories'
 4 - Auth search explodes
 5 - Apply patch
 6 - Repeat and confirm the search results return
 7 - Import and save the GENRE/FORM record for Short stories
 8 - Repeat the search and import the same record
 9 - Confirm that upon save you are notified of duplicate, don't save
10 - set  QueryRegexEscapeOptions to 'Escape' and confirm Z39 searching works and importing/save notifies of duplicate
11 - set SearchEngine to Zebra and confirm Z39 searching works and importing/save notifies of duplicate
Comment 4 ByWater Sandboxes 2020-01-17 16:06:10 UTC
Created attachment 97543 [details] [review]
Bug 24286: Escape forward slash in GENRE/FORM (and any authtype)

Note that bug 24267 will fix the issue during Z39 searching for new auth, but the duplicate check at saving will still fail

To test:
 0 - Set SearchEngine to Elasticsearch,  QueryRegexEscapeOptions  to 'Don't Escape'
 1 - Browse to Authorities
 2 - Select New->New from Z3950
 3 - Search for subject 'Short stories'
 4 - Auth search explodes
 5 - Apply patch
 6 - Repeat and confirm the search results return
 7 - Import and save the GENRE/FORM record for Short stories
 8 - Repeat the search and import the same record
 9 - Confirm that upon save you are notified of duplicate, don't save
10 - set  QueryRegexEscapeOptions to 'Escape' and confirm Z39 searching works and importing/save notifies of duplicate
11 - set SearchEngine to Zebra and confirm Z39 searching works and importing/save notifies of duplicate

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 5 Myka Kennedy Stephens 2020-01-18 21:04:58 UTC
Created attachment 97582 [details] [review]
Bug 24286: Escape forward slash in GENRE/FORM (and any authtype)

Note that bug 24267 will fix the issue during Z39 searching for new auth, but the duplicate check at saving will still fail

To test:
 0 - Set SearchEngine to Elasticsearch,  QueryRegexEscapeOptions  to 'Don't Escape'
 1 - Browse to Authorities
 2 - Select New->New from Z3950
 3 - Search for subject 'Short stories'
 4 - Auth search explodes
 5 - Apply patch
 6 - Repeat and confirm the search results return
 7 - Import and save the GENRE/FORM record for Short stories
 8 - Repeat the search and import the same record
 9 - Confirm that upon save you are notified of duplicate, don't save
10 - set  QueryRegexEscapeOptions to 'Escape' and confirm Z39 searching works and importing/save notifies of duplicate
11 - set SearchEngine to Zebra and confirm Z39 searching works and importing/save notifies of duplicate

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Comment 6 Myka Kennedy Stephens 2020-01-18 21:05:50 UTC
Patch works as expected. Thank you!
Comment 7 Jonathan Druart 2020-01-21 15:19:47 UTC
Created attachment 97671 [details] [review]
Bug 24286: Escape forward slash in GENRE/FORM (and any authtype)

Note that bug 24267 will fix the issue during Z39 searching for new auth, but the duplicate check at saving will still fail

To test:
 0 - Set SearchEngine to Elasticsearch,  QueryRegexEscapeOptions  to 'Don't Escape'
 1 - Browse to Authorities
 2 - Select New->New from Z3950
 3 - Search for subject 'Short stories'
 4 - Auth search explodes
 5 - Apply patch
 6 - Repeat and confirm the search results return
 7 - Import and save the GENRE/FORM record for Short stories
 8 - Repeat the search and import the same record
 9 - Confirm that upon save you are notified of duplicate, don't save
10 - set  QueryRegexEscapeOptions to 'Escape' and confirm Z39 searching works and importing/save notifies of duplicate
11 - set SearchEngine to Zebra and confirm Z39 searching works and importing/save notifies of duplicate

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Martin Renvoize 2020-01-23 09:10:51 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 9 Joy Nelson 2020-02-06 23:04:10 UTC
Pushed to 19.11.x for 19.11.03
Comment 10 Lucas Gass 2020-02-13 20:36:07 UTC
19.05.x does not include QueryRegexEscapeOptions, no backport