Bugzilla – Attachment 139853 Details for
Bug 31023
Cannot create new GENRE/FORM authorities when QueryRegexEscapeOptions set to 'Unescape escaped'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31023: Quote authtypecode in FindDuplicateAuthorities
Bug-31023-Quote-authtypecode-in-FindDuplicateAutho.patch (text/plain), 1.93 KB, created by
Katrin Fischer
on 2022-08-27 13:06:33 UTC
(
hide
)
Description:
Bug 31023: Quote authtypecode in FindDuplicateAuthorities
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2022-08-27 13:06:33 UTC
Size:
1.93 KB
patch
obsolete
>From 7aef81e985a00087facd03049b008e8a6beb889e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 12 Jul 2022 13:46:55 +0000 >Subject: [PATCH] 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> >--- > C4/AuthoritiesMarc.pm | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index e211af2b94..ab234725ec 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -784,15 +784,11 @@ Comments : an improvement would be to return All the records that match. > sub FindDuplicateAuthority { > > my ($record,$authtypecode)=@_; >-# warn "IN for ".$record->as_formatted; > my $dbh = C4::Context->dbh; >-# warn "".$record->as_formatted; > my $auth_tag_to_report = Koha::Authority::Types->find($authtypecode)->auth_tag_to_report; >-# warn "record :".$record->as_formatted." auth_tag_to_report :$auth_tag_to_report"; > # build a request for SearchAuthorities > my $op = 'AND'; >- $authtypecode =~ s#/#\\/#; # GENRE/FORM contains forward slash which is a reserved character >- my $query='at:'.$authtypecode.' '; >+ my $query='at:"'.$authtypecode.'" '; # Quote authtype code to avoid unescaping slash in GENRE/FORM later > my $filtervalues=qr([\001-\040\Q!'"`#$%&*+,-./:;<=>?@(){[}_|~\E\]]); > if ($record->field($auth_tag_to_report)) { > foreach ($record->field($auth_tag_to_report)->subfields()) { >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31023
:
137631
|
137632
|
137662
|
137663
|
139852
| 139853