Summary: | Cannot create new GENRE/FORM authorities when QueryRegexEscapeOptions set to 'Unescape escaped' | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Searching - Elasticsearch | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | arthur.suzuki, lucas, tomascohen, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
22.11.00, 22.05.07, 21.11.14
|
|
Circulation function: | |||
Attachments: |
Bug 31023: Unit tests
Bug 31023: Quote authtypecode in FindDuplicateAuthorities Bug 31023: Unit tests Bug 31023: Quote authtypecode in FindDuplicateAuthorities Bug 31023: Unit tests Bug 31023: Quote authtypecode in FindDuplicateAuthorities |
Description
Nick Clemens (kidclamp)
2022-06-23 10:08:29 UTC
Created attachment 137631 [details] [review] Bug 31023: Unit tests Created attachment 137632 [details] [review] Bug 31023: Quote authtypecode in FindDuplicateAuthorities To test: 0 - Have Koha using Elasticsearch 1 - Set QueryRegexEscapeOptions to 'unescape escaped' 2 - Attempt to add a new 'GENRE/FORM' authority record 3 - On save you get a 500 error Unable to understand your search query, please rephrase and try again. at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/Search.pm line 102 4 - Apply patch, restart all 5 - Attempt to add a new 'GENRE/FORM' authority record 6 - Success! Created attachment 137662 [details] [review] Bug 31023: Unit tests Signed-off-by: David Nind <david@davidnind.com> Created attachment 137663 [details] [review] Bug 31023: Quote authtypecode in FindDuplicateAuthorities To test: 0 - Have Koha using Elasticsearch 1 - Set QueryRegexEscapeOptions to 'unescape escaped' 2 - Attempt to add a new 'GENRE/FORM' authority record 3 - On save you get a 500 error Unable to understand your search query, please rephrase and try again. at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/Search.pm line 102 4 - Apply patch, restart all 5 - Attempt to add a new 'GENRE/FORM' authority record 6 - Success! Signed-off-by: David Nind <david@davidnind.com> Nick, please don't forget to assign yourself! Created attachment 139852 [details] [review] Bug 31023: Unit tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 139853 [details] [review] Bug 31023: Quote authtypecode in FindDuplicateAuthorities To test: 0 - Have Koha using Elasticsearch 1 - Set QueryRegexEscapeOptions to 'unescape escaped' 2 - Attempt to add a new 'GENRE/FORM' authority record 3 - On save you get a 500 error Unable to understand your search query, please rephrase and try again. at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/Search.pm line 102 4 - Apply patch, restart all 5 - Attempt to add a new 'GENRE/FORM' authority record 6 - Success! Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Hi, Nick. Do you think you could use Koha::SearchEngine::Zebra::QueryBuilder::clean_search_term on the authtypecode? (In reply to Tomás Cohen Arazi from comment #8) > Hi, Nick. Do you think you could use > Koha::SearchEngine::Zebra::QueryBuilder::clean_search_term on the > authtypecode? I think that might be overkill on this one - everythign already works in Zebra - in ES, it only doesn't work under a special case where we are unescaping values as specified by the pref. Ideally, I think we would just remove the slash from the type, GENRE_FORM, or something. Pushed to master for 22.11. Nice work everyone, thanks! Backported to 22.05.x for upcoming 22.05.07 release applied to 21.11.x for 21.11.14 Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved. |