From 663c400bfe48a12847b4d0586f6c2c22ea1c09ba Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Thu, 15 Nov 2012 12:30:20 +0100 Subject: [PATCH 2/2] Bug 9072: Add CheckValidity option to Linker (followup 1) --- C4/Heading.pm | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/C4/Heading.pm b/C4/Heading.pm index 9adb75c..788f8ef 100644 --- a/C4/Heading.pm +++ b/C4/Heading.pm @@ -149,10 +149,11 @@ If passed a true value for $checkvalidity, SearchAuthorities will check authorit =cut sub authorities { - my $self = shift; - my $skipmetadata = shift; + my $self = shift; + my $skipmetadata = shift; my $checkvalidity = shift; - my ( $results, $total ) = _search( $self, 'match-heading', $skipmetadata, $checkvalidity ); + my ( $results, $total ) = + _search( $self, 'match-heading', $skipmetadata, $checkvalidity ); return $results; } @@ -179,9 +180,9 @@ sub preferred_authorities { =cut sub _search { - my $self = shift; - my $index = shift || undef; - my $skipmetadata = shift || undef; + my $self = shift; + my $index = shift || undef; + my $skipmetadata = shift || undef; my $checkvalidity = shift || undef; my @marclist; my @and_or; @@ -205,15 +206,15 @@ sub _search { # } require C4::AuthoritiesMarc; my ( $authorities, $nbresults ) = C4::AuthoritiesMarc::SearchAuthorities( - \@marclist, \@and_or, \@excluding, \@operator, - \@value, 0, 20, $self->{'auth_type'}, - 'AuthidAsc', $skipmetadata + \@marclist, \@and_or, \@excluding, \@operator, + \@value, 0, 20, $self->{'auth_type'}, + 'AuthidAsc', $skipmetadata ); if ($checkvalidity) { my @authorities_cheked; foreach (@$authorities) { - # TODO should be merged with C4::Biblio->_check_valid_auth_link + # TODO should be merged with C4::Biblio->_check_valid_auth_link my $authorized_heading = C4::AuthoritiesMarc::GetAuthorizedHeading( { authid => $_->{'authid'} } ); my $field_value = -- 1.7.9.5