From 257af617f65cc086ecd31f9343d9a0c5c986a571 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 18 Apr 2008 17:11:41 -0500 Subject: [PATCH] fix crash when saving MARC21 bib with NoZebra and BiblioAddsAuthority ON Needed to identify correct subfield for retrieving the authority type. Signed-off-by: Joshua Ferraro --- C4/Biblio.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 7d7e491e32..a6f0a2837a 100755 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -2168,12 +2168,13 @@ sub _DelBiblioNoZebra { $title = lc($record->subfield($titletag,$titlesubfield)); } else { # for authorities, the "title" is the $a mainentry - my $authref = C4::AuthoritiesMarc::GetAuthType($record->subfield(152,'b')); + my ($auth_type_tag, $auth_type_sf) = C4::AuthoritiesMarc::get_auth_type_location(); + my $authref = C4::AuthoritiesMarc::GetAuthType($record->subfield($auth_type_tag, $auth_type_sf)); warn "ERROR : authtype undefined for ".$record->as_formatted unless $authref; $title = $record->subfield($authref->{auth_tag_to_report},'a'); $index{'mainmainentry'}= $authref->{'auth_tag_to_report'}.'a'; $index{'mainentry'} = $authref->{'auth_tag_to_report'}.'*'; - $index{'auth_type'} = '152b'; + $index{'auth_type'} = "${auth_type_tag}${auth_type_sf}"; } my %result; @@ -2262,12 +2263,13 @@ sub _AddBiblioNoZebra { } else { # warn "server : $server"; # for authorities, the "title" is the $a mainentry - my $authref = C4::AuthoritiesMarc::GetAuthType($record->subfield(152,'b')); + my ($auth_type_tag, $auth_type_sf) = C4::AuthoritiesMarc::get_auth_type_location(); + my $authref = C4::AuthoritiesMarc::GetAuthType($record->subfield($auth_type_tag, $auth_type_sf)); warn "ERROR : authtype undefined for ".$record->as_formatted unless $authref; $title = $record->subfield($authref->{auth_tag_to_report},'a'); $index{'mainmainentry'} = $authref->{auth_tag_to_report}.'a'; $index{'mainentry'} = $authref->{auth_tag_to_report}.'*'; - $index{'auth_type'} = '152b'; + $index{'auth_type'} = "${auth_type_tag}${auth_type_sf}"; } # remove blancks comma (that could cause problem when decoding the string for CQL retrieval) and regexp specific values -- 2.39.5