diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index c6924e146c..1fc0a57c26 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -598,7 +598,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")#; } my ($error, $query_str) = $builder->build_query_compat( undef, [$searchstr], undef, undef, [$sort], 0 ); if( $error ){ diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t index dc9f0b9bcc..14fab65a60 100755 --- a/t/db_dependent/Koha/Biblio.t +++ b/t/db_dependent/Koha/Biblio.t @@ -572,7 +572,7 @@ subtest 'get_components_query' => sub { t::lib::Mocks::mock_preference( 'ComponentSortField', 'author' ); t::lib::Mocks::mock_preference( 'ComponentSortOrder', 'za' ); my ( $comp_q, $comp_s ) = $biblio->get_components_query; - is($comp_q, "Host-item:(Some boring read)",, "UseControlNumber disabled"); + is($comp_q, 'Host-item:("Some boring read")', "UseControlNumber disabled"); is($comp_s, "author_za", "UseControlNumber disabled sort is correct"); t::lib::Mocks::mock_preference( 'UseControlNumber', '1' );