@@ -, +, @@ many component parts --- Koha/Biblio.pm | 4 ++-- t/db_dependent/Koha/Biblio.t | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) --- a/Koha/Biblio.pm +++ a/Koha/Biblio.pm @@ -595,12 +595,12 @@ sub get_components_query { if ( !defined($pf003) ) { # search for 773$w='Host001' - $searchstr .= "rcn:" . $pf001->data(); + $searchstr .= "rcn:\"" . $pf001->data()."\""; } else { $searchstr .= "("; # search for (773$w='Host001' and 003='Host003') or 773$w='(Host003)Host001' - $searchstr .= "(rcn:" . $pf001->data() . " AND cni:" . $pf003->data() . ")"; + $searchstr .= "(rcn:\"" . $pf001->data() . "\" AND cni:\"" . $pf003->data() . "\")"; $searchstr .= " OR rcn:\"" . $pf003->data() . " " . $pf001->data() . "\""; $searchstr .= ")"; } --- a/t/db_dependent/Koha/Biblio.t +++ a/t/db_dependent/Koha/Biblio.t @@ -583,7 +583,7 @@ subtest 'get_components_query' => sub { $biblio = Koha::Biblios->find( $biblio->biblionumber); ( $comp_q, $comp_s ) = $biblio->get_components_query; - is($comp_q, "(rcn:$biblionumber AND (bib-level:a OR bib-level:b))", "UseControlNumber enabled without MarcOrgCode"); + is($comp_q, "(rcn:\"$biblionumber\" AND (bib-level:a OR bib-level:b))", "UseControlNumber enabled without MarcOrgCode"); is($comp_s, "author_az", "UseControlNumber enabled without MarcOrgCode sort is correct"); my $marc_003_field = MARC::Field->new('003', 'OSt'); @@ -594,7 +594,7 @@ subtest 'get_components_query' => sub { t::lib::Mocks::mock_preference( 'ComponentSortField', 'title' ); t::lib::Mocks::mock_preference( 'ComponentSortOrder', 'asc' ); ( $comp_q, $comp_s ) = $biblio->get_components_query; - is($comp_q, "(((rcn:$biblionumber AND cni:OSt) OR rcn:\"OSt $biblionumber\") AND (bib-level:a OR bib-level:b))", "UseControlNumber enabled with MarcOrgCode"); + is($comp_q, "(((rcn:\"$biblionumber\" AND cni:\"OSt\") OR rcn:\"OSt $biblionumber\") AND (bib-level:a OR bib-level:b))", "UseControlNumber enabled with MarcOrgCode"); is($comp_s, "title_asc", "UseControlNumber enabled with MarcOrgCode sort if correct"); }; --