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

(-)a/C4/Biblio.pm (-3 / +7 lines)
Lines 667-672 sub LinkBibHeadingsToAuthorities { Link Here
667
    my $tagtolink     = shift;
667
    my $tagtolink     = shift;
668
    my $verbose = shift;
668
    my $verbose = shift;
669
    my %results;
669
    my %results;
670
    my $memory_cache = Koha::Cache::Memory::Lite->get_instance();
670
    if (!$bib) {
671
    if (!$bib) {
671
        carp 'LinkBibHeadingsToAuthorities called on undefined bib record';
672
        carp 'LinkBibHeadingsToAuthorities called on undefined bib record';
672
        return ( 0, {});
673
        return ( 0, {});
Lines 708-714 sub LinkBibHeadingsToAuthorities { Link Here
708
            push(@{$results{'details'}}, { tag => $field->tag(), authid => $authid, status => 'LOCAL_FOUND'}) if $verbose;
709
            push(@{$results{'details'}}, { tag => $field->tag(), authid => $authid, status => 'LOCAL_FOUND'}) if $verbose;
709
        }
710
        }
710
        else {
711
        else {
711
            my $authority_type = Koha::Authority::Types->find( $heading->auth_type() );
712
            my $authority_type =
713
                $memory_cache->get_from_cache( "LinkBibHeadingsToAuthorities:AuthorityType:" . $heading->auth_type() );
714
            unless ($authority_type) {
715
                $authority_type = Koha::Authority::Types->find( $heading->auth_type() );
716
                $memory_cache->set_in_cache( "LinkBibHeadingsToAuthorities:AuthorityType:" . $heading->auth_type() );
717
            }
712
            if ( defined $current_link
718
            if ( defined $current_link
713
                && (!$allowrelink || C4::Context->preference('LinkerKeepStale')) )
719
                && (!$allowrelink || C4::Context->preference('LinkerKeepStale')) )
714
            {
720
            {
Lines 722-728 sub LinkBibHeadingsToAuthorities { Link Here
722
                    $results{'unlinked'}->{ $heading->display_form() }++;
728
                    $results{'unlinked'}->{ $heading->display_form() }++;
723
                    push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'MULTIPLE_MATCH', auth_type => $heading->auth_type(), tag_to_report => $authority_type->auth_tag_to_report}) if $verbose;
729
                    push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'MULTIPLE_MATCH', auth_type => $heading->auth_type(), tag_to_report => $authority_type->auth_tag_to_report}) if $verbose;
724
                } elsif ( !$match_count ) {
730
                } elsif ( !$match_count ) {
725
                    my $authority_type = Koha::Authority::Types->find( $heading->auth_type() );
726
                    my $marcrecordauth = MARC::Record->new();
731
                    my $marcrecordauth = MARC::Record->new();
727
                    if ( C4::Context->preference('marcflavour') eq 'MARC21' ) {
732
                    if ( C4::Context->preference('marcflavour') eq 'MARC21' ) {
728
                        $marcrecordauth->leader('     nz  a22     o  4500');
733
                        $marcrecordauth->leader('     nz  a22     o  4500');
729
- 

Return to bug 37349