@@ -, +, @@ --- Koha/Biblio.pm | 4 ++-- Koha/Util/Search.pm | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) --- a/Koha/Biblio.pm +++ a/Koha/Biblio.pm @@ -510,7 +510,7 @@ this object (MARC21 773$w points to this) sub get_marc_components { my ($self, $max_results) = @_; - return if (C4::Context->preference('marcflavour') ne 'MARC21'); + return [] if (C4::Context->preference('marcflavour') ne 'MARC21'); my $searchstr = Koha::Util::Search::get_component_part_query($self->id); @@ -520,7 +520,7 @@ sub get_marc_components { $self->{_components} = $results if ( defined($results) && scalar(@$results) ); } - return $self->{_components} || (); + return $self->{_components} || []; } =head3 subscriptions --- a/Koha/Util/Search.pm +++ a/Koha/Util/Search.pm @@ -47,13 +47,13 @@ sub get_component_part_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 .= " OR rcn=\"" . $pf003->data() . " " . $pf001->data() . "\""; + $searchstr .= "(rcn:" . $pf001->data() . " AND cni:" . $pf003->data() . ")"; + $searchstr .= " OR rcn:" . $pf003->data() . " " . $pf001->data(); $searchstr .= ")"; } @@ -66,6 +66,8 @@ sub get_component_part_query { $cleaned_title =~ tr|/||; $searchstr = "Host-item:($cleaned_title)"; } + + return $searchstr; } 1; --