Lines 643-648
sub LinkBibHeadingsToAuthorities {
Link Here
|
643 |
my $tagtolink = shift; |
643 |
my $tagtolink = shift; |
644 |
my $verbose = shift; |
644 |
my $verbose = shift; |
645 |
my %results; |
645 |
my %results; |
|
|
646 |
my $memory_cache = Koha::Cache::Memory::Lite->get_instance(); |
646 |
if (!$bib) { |
647 |
if (!$bib) { |
647 |
carp 'LinkBibHeadingsToAuthorities called on undefined bib record'; |
648 |
carp 'LinkBibHeadingsToAuthorities called on undefined bib record'; |
648 |
return ( 0, {}); |
649 |
return ( 0, {}); |
Lines 684-690
sub LinkBibHeadingsToAuthorities {
Link Here
|
684 |
push(@{$results{'details'}}, { tag => $field->tag(), authid => $authid, status => 'LOCAL_FOUND'}) if $verbose; |
685 |
push(@{$results{'details'}}, { tag => $field->tag(), authid => $authid, status => 'LOCAL_FOUND'}) if $verbose; |
685 |
} |
686 |
} |
686 |
else { |
687 |
else { |
687 |
my $authority_type = Koha::Authority::Types->find( $heading->auth_type() ); |
688 |
my $authority_type = $memory_cache->get_from_cache( "LinkBibHeadingsToAuthorities:AuthorityType:" . $heading->auth_type() ); |
|
|
689 |
unless ( $authority_type ){ |
690 |
$authority_type = Koha::Authority::Types->find( $heading->auth_type() ); |
691 |
$memory_cache->set_in_cache( "LinkBibHeadingsToAuthorities:AuthorityType:" . $ heading->auth_type() ); |
692 |
} |
688 |
if ( defined $current_link |
693 |
if ( defined $current_link |
689 |
&& (!$allowrelink || C4::Context->preference('LinkerKeepStale')) ) |
694 |
&& (!$allowrelink || C4::Context->preference('LinkerKeepStale')) ) |
690 |
{ |
695 |
{ |
Lines 698-704
sub LinkBibHeadingsToAuthorities {
Link Here
|
698 |
$results{'unlinked'}->{ $heading->display_form() }++; |
703 |
$results{'unlinked'}->{ $heading->display_form() }++; |
699 |
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; |
704 |
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; |
700 |
} elsif ( !$match_count ) { |
705 |
} elsif ( !$match_count ) { |
701 |
my $authority_type = Koha::Authority::Types->find( $heading->auth_type() ); |
|
|
702 |
my $marcrecordauth = MARC::Record->new(); |
706 |
my $marcrecordauth = MARC::Record->new(); |
703 |
if ( C4::Context->preference('marcflavour') eq 'MARC21' ) { |
707 |
if ( C4::Context->preference('marcflavour') eq 'MARC21' ) { |
704 |
$marcrecordauth->leader(' nz a22 o 4500'); |
708 |
$marcrecordauth->leader(' nz a22 o 4500'); |
705 |
- |
|
|