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

(-)a/C4/Heading.pm (-4 / +22 lines)
Lines 22-28 use Modern::Perl; Link Here
22
use MARC::Field;
22
use MARC::Field;
23
use C4::Context;
23
use C4::Context;
24
use Module::Load qw( load );
24
use Module::Load qw( load );
25
use List::Util qw( none );
25
use List::Util qw( none first );
26
26
27
=head1 NAME
27
=head1 NAME
28
28
Lines 222-227 sub _search { Link Here
222
        push @value, $thesaurus;
222
        push @value, $thesaurus;
223
    }
223
    }
224
224
225
    if ( C4::Context->preference('ConsiderHeadingUse') ) {
226
        my $marcflavour = C4::Context->preference('marcflavour');
227
        my $biblio_tag  = $self->{'field'}->tag;
228
        if ( $marcflavour eq 'MARC21' ) {
229
            my $heading_use_search_field =
230
                  $biblio_tag =~ /^[127]/ ? 'Heading-use-main-or-added-entry'
231
                : $biblio_tag =~ /^6/     ? 'Heading-use-subject-added-entry'
232
                : $biblio_tag =~ /^[48]/  ? 'Heading-use-series-added-entry'
233
                :                           undef;
234
            if ($heading_use_search_field) {
235
                push @marclist,  $heading_use_search_field;
236
                push @and_or,    'and';
237
                push @excluding, '';
238
                push @operator,  'is';
239
                push @value,     'a';
240
            }
241
        }
242
    }
243
225
    require Koha::SearchEngine::QueryBuilder;
244
    require Koha::SearchEngine::QueryBuilder;
226
    require Koha::SearchEngine::Search;
245
    require Koha::SearchEngine::Search;
227
246
Lines 253-260 sub _search { Link Here
253
        )
272
        )
254
      )
273
      )
255
    {
274
    {
256
        pop @value;
275
        my $thesaurus_idx = first { $marclist[$_] eq 'thesaurus' } 0 .. $#marclist;
257
        push @value, 'notdefined';
276
        $value[$thesaurus_idx] = 'notdefined';
258
        $search_query =
277
        $search_query =
259
          $builder->build_authorities_query_compat( \@marclist, \@and_or,
278
          $builder->build_authorities_query_compat( \@marclist, \@and_or,
260
            \@excluding, \@operator, \@value, $self->{'auth_type'},
279
            \@excluding, \@operator, \@value, $self->{'auth_type'},
261
- 

Return to bug 33296