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

(-)a/Koha/Util/Search.pm (-3 / +3 lines)
Lines 45-55 sub get_component_part_query { Link Here
45
45
46
        if (!defined($pf003)) {
46
        if (!defined($pf003)) {
47
            # search for 773$w='Host001'
47
            # search for 773$w='Host001'
48
            $searchstr = "rcn='".$pf001->data()."'";
48
            $searchstr = "rcn=\"".$pf001->data()."\"";
49
        } else {
49
        } else {
50
            # search for (773$w='Host001' and 003='Host003') or 773$w='Host003 Host001')
50
            # search for (773$w='Host001' and 003='Host003') or 773$w='Host003 Host001')
51
            $searchstr = "(rcn='".$pf001->data()."' AND cni='".$pf003->data()."')";
51
            $searchstr = "(rcn=\"".$pf001->data()."\" AND cni=\"".$pf003->data()."\")";
52
            $searchstr .= " OR rcn='".$pf003->data()." ".$pf001->data()."'";
52
            $searchstr .= " OR rcn=\"".$pf003->data()." ".$pf001->data()."\"";
53
        }
53
        }
54
    }
54
    }
55
}
55
}
(-)a/t/Koha/Util/Search.t (-2 / +1 lines)
Lines 38-42 subtest 'get_component_part_query' => sub { Link Here
38
    $record->append_fields($marc_001_field);
38
    $record->append_fields($marc_001_field);
39
    ModBiblioMarc($record, $biblionumber);
39
    ModBiblioMarc($record, $biblionumber);
40
40
41
    is(Koha::Util::Search::get_component_part_query($biblionumber), "rcn='$biblionumber'");
41
    is(Koha::Util::Search::get_component_part_query($biblionumber), "rcn=\"$biblionumber\"");
42
};
42
};
43
- 

Return to bug 11175