Bug 7442 (follow-up) ensuring that summary is display when searching on all types of authorities

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 <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ebcb64e9fa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Fridolyn SOMERS 2013-07-18 18:13:12 +02:00 committed by Fridolin Somers
parent cc6fcc1c27
commit 100e655db5
1 changed files with 6 additions and 5 deletions

View File

@ -274,8 +274,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);
@ -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;