From a31651a08de33b4418c83a1302111b7988a24564 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Thu, 18 Jul 2013 18:13:12 +0200 Subject: [PATCH] [PASSED QA] Bug 7442 - Follow up : Authorities search on all types does not show summary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 --- C4/AuthoritiesMarc.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 753fbbd..35544dc 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -274,8 +274,6 @@ sub SearchAuthorities { my %newline; $newline{authid} = $authid; if ( !$skipmetadata ) { - my $summary = - BuildSummary( $authrecord, $authid, $authtypecode ); my $query_auth_tag = "SELECT auth_tag_to_report FROM auth_types WHERE authtypecode=?"; my $sth = $dbh->prepare($query_auth_tag); @@ -284,15 +282,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; -- 1.8.3.2