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

(-)a/C4/Search.pm (-5 / +7 lines)
Lines 656-662 sub getRecords { Link Here
656
    C4::Search::_get_facets_data_from_record( $marc_record, $facets, $facets_counter );
656
    C4::Search::_get_facets_data_from_record( $marc_record, $facets, $facets_counter );
657
657
658
Internal function that extracts facets information from a MARC::Record object
658
Internal function that extracts facets information from a MARC::Record object
659
and populates $facets_counter for using in getRecords.
659
and populates $facets_counter and $facets_info for using in getRecords.
660
660
661
$facets is expected to be filled with C4::Koha::getFacets output (i.e. the configured
661
$facets is expected to be filled with C4::Koha::getFacets output (i.e. the configured
662
facets for Zebra).
662
facets for Zebra).
Lines 673-686 sub _get_facets_data_from_record { Link Here
673
673
674
        foreach my $tag ( @{ $facet->{ tags } } ) {
674
        foreach my $tag ( @{ $facet->{ tags } } ) {
675
675
676
            # avoid first line
676
            # tag number is the first three digits
677
            my $tag_num          = substr( $tag, 0, 3 );
677
            my $tag_num          = substr( $tag, 0, 3 );
678
            # subfields are the remainder
678
            my $subfield_letters = substr( $tag, 3 );
679
            my $subfield_letters = substr( $tag, 3 );
679
            # Removed when as_string fixed
680
            my @subfields = $subfield_letters =~ /./sg;
681
680
682
            my @fields = $marc_record->field( $tag_num );
681
            my @fields = $marc_record->field( $tag_num );
683
            foreach my $field (@fields) {
682
            foreach my $field (@fields) {
683
                # If $field->indicator(1) eq 'z', it means it is a 'see from'
684
                # field introduced because of IncludeSeeFromInSearches, so skip it
685
                next if $field->indicator(1) eq 'z';
686
684
                my $data = $field->as_string( $subfield_letters, $facet->{ sep } );
687
                my $data = $field->as_string( $subfield_letters, $facet->{ sep } );
685
688
686
                unless ( grep { /^\Q$data\E$/ } @used_datas ) {
689
                unless ( grep { /^\Q$data\E$/ } @used_datas ) {
687
- 

Return to bug 12788