View | Details | Raw Unified | Return to bug 11175
Collapse All | Expand All

(-)a/Koha/Biblio.pm (-2 / +2 lines)
Lines 510-516 this object (MARC21 773$w points to this) Link Here
510
sub get_marc_components {
510
sub get_marc_components {
511
    my ($self, $max_results) = @_;
511
    my ($self, $max_results) = @_;
512
512
513
    return if (C4::Context->preference('marcflavour') ne 'MARC21');
513
    return [] if (C4::Context->preference('marcflavour') ne 'MARC21');
514
514
515
    my $searchstr = Koha::Util::Search::get_component_part_query($self->id);
515
    my $searchstr = Koha::Util::Search::get_component_part_query($self->id);
516
516
Lines 520-526 sub get_marc_components { Link Here
520
        $self->{_components} = $results if ( defined($results) && scalar(@$results) );
520
        $self->{_components} = $results if ( defined($results) && scalar(@$results) );
521
    }
521
    }
522
522
523
    return $self->{_components} || ();
523
    return $self->{_components} || [];
524
}
524
}
525
525
526
=head3 subscriptions
526
=head3 subscriptions
(-)a/Koha/Util/Search.pm (-4 / +5 lines)
Lines 47-59 sub get_component_part_query { Link Here
47
47
48
            if ( !defined($pf003) ) {
48
            if ( !defined($pf003) ) {
49
                # search for 773$w='Host001'
49
                # search for 773$w='Host001'
50
                $searchstr = "rcn=\"" . $pf001->data() . "\"";
50
                $searchstr = "rcn:" . $pf001->data();
51
            }
51
            }
52
            else {
52
            else {
53
                $searchstr  = "(";
53
                $searchstr  = "(";
54
                # search for (773$w='Host001' and 003='Host003') or 773$w='Host003 Host001')
54
                # search for (773$w='Host001' and 003='Host003') or 773$w='Host003 Host001')
55
                $searchstr .= "(rcn=\"" . $pf001->data() . "\" AND cni=\"" . $pf003->data() . "\")";
55
                $searchstr .= "(rcn:" . $pf001->data() . " AND cni:" . $pf003->data() . ")";
56
                $searchstr .= " OR rcn=\"" . $pf003->data() . " " . $pf001->data() . "\"";
56
                $searchstr .= " OR rcn:" . $pf003->data() . " " . $pf001->data();
57
                $searchstr .= ")";
57
                $searchstr .= ")";
58
            }
58
            }
59
            
59
            
Lines 66-71 sub get_component_part_query { Link Here
66
        $cleaned_title =~ tr|/||;
66
        $cleaned_title =~ tr|/||;
67
        $searchstr = "Host-item:($cleaned_title)";
67
        $searchstr = "Host-item:($cleaned_title)";
68
    }
68
    }
69
70
    return $searchstr;
69
}
71
}
70
72
71
1;
73
1;
72
- 

Return to bug 11175