Bugzilla – Attachment 135445 Details for
Bug 30865
Koha::Biblio->get_components_query should double quote Host-item search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30865: Double-quote Host-item in Koha::Biblio->get_components_query
Bug-30865-Double-quote-Host-item-in-KohaBiblio-get.patch (text/plain), 2.22 KB, created by
David Cook
on 2022-05-30 04:10:08 UTC
(
hide
)
Description:
Bug 30865: Double-quote Host-item in Koha::Biblio->get_components_query
Filename:
MIME Type:
Creator:
David Cook
Created:
2022-05-30 04:10:08 UTC
Size:
2.22 KB
patch
obsolete
>From 5893038a387d5d5443133655da2186b91bf5bead Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 30 May 2022 03:31:44 +0000 >Subject: [PATCH] Bug 30865: Double-quote Host-item in > Koha::Biblio->get_components_query > >This patch adds double quotes around the term qualified by "Host-item" >in Koha::Biblio->get_components_query(). > >Without them, reserved charactrs like "=" will cause syntax errors like >"CCL parsing error (10014) Unknown qualifier ZOOM for query: > Host-item=(MyTitle = Mysubtitle) > at /usr/share/koha/lib/C4/Search.pm line 245." > >Test plan: >0) Don't apply the patch >1) Create biblio with title and subtitle like (MyTitle : MySubtitle) >2) Note the warning "There was an error searching for >analytic records, please see the logs for details." on the detail page > >3) Apply the patch >4) koha-plack --restart kohadev > >5) Refresh the detail page >6) Note that the warning message is gone > >7) prove t/db_dependent/Koha/Biblio.t >--- > Koha/Biblio.pm | 2 +- > t/db_dependent/Koha/Biblio.t | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 087efc78a6..104601f45b 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -595,7 +595,7 @@ sub get_components_query { > my $cleaned_title = $marc->subfield('245', "a"); > $cleaned_title =~ tr|/||; > $cleaned_title = $builder->clean_search_term($cleaned_title); >- $searchstr = "Host-item:($cleaned_title)"; >+ $searchstr = qq#Host-item:("$cleaned_title")#; > } > > return $searchstr; >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 3065eae646..1ae1fe03e5 100755 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -569,7 +569,7 @@ subtest 'get_components_query' => sub { > my $record = $biblio->metadata->record; > > t::lib::Mocks::mock_preference( 'UseControlNumber', '0' ); >- is($biblio->get_components_query, "Host-item:(Some boring read)", "UseControlNumber disabled"); >+ is($biblio->get_components_query, 'Host-item:("Some boring read")', "UseControlNumber disabled"); > > t::lib::Mocks::mock_preference( 'UseControlNumber', '1' ); > my $marc_001_field = MARC::Field->new('001', $biblionumber); >-- >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 30865
:
135445
|
136669