From ebcb64e9fa51fd7f02918d9543abeeac4f8ab46d Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Thu, 18 Jul 2013 18:13:12 +0200 Subject: [PATCH] Bug 7442 (follow-up) ensuring that summary is display when searching on all types of authorities MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch corrects a small bug : Authorities search on all types does not show summary because it is computed with selected type (which is empty) instead of using found authority type. Test plan : - Go to intranet autorities search - Perform a search on all authorities types - Look at results => Without this patch, results rows do not display the autority summary, only authorized headings Signed-off-by: Frédéric Demians Signed-off-by: Katrin Fischer Signed-off-by: Galen Charlton --- C4/AuthoritiesMarc.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index eb1308712e..1e843ec314 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -281,8 +281,6 @@ sub SearchAuthorities { my %newline; $newline{authid} = $authid; if ( !$skipmetadata ) { - my $summary = - BuildSummary( $authrecord, $authid, GetAuthTypeCode($authid) ); my $query_auth_tag = "SELECT auth_tag_to_report FROM auth_types WHERE authtypecode=?"; my $sth = $dbh->prepare($query_auth_tag); @@ -291,15 +289,18 @@ sub SearchAuthorities { my $reported_tag; my $mainentry = $authrecord->field($auth_tag_to_report); if ($mainentry) { - foreach ( $mainentry->subfields() ) { $reported_tag .= '$' . $_->[0] . $_->[1]; } } - my $thisauthtype = GetAuthType(GetAuthTypeCode($authid)); + my $thisauthtypecode = GetAuthTypeCode($authid); + my $thisauthtype = GetAuthType($thisauthtypecode); unless (defined $thisauthtype) { - $thisauthtype = GetAuthType($authtypecode) if $authtypecode; + $thisauthtypecode = $authtypecode; + $thisauthtype = GetAuthType($authtypecode); } + my $summary = BuildSummary( $authrecord, $authid, $thisauthtypecode ); + $newline{authtype} = defined($thisauthtype) ? $thisauthtype->{'authtypetext'} : ''; $newline{summary} = $summary; -- 2.39.5