Fix fatal error on authority search when biblioaddauthority syspref is set.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Ryan Higgins 2007-12-28 11:41:32 -06:00 committed by Joshua Ferraro
parent 7ad86c3a8e
commit 74a76e539d
1 changed files with 4 additions and 0 deletions

View File

@ -682,6 +682,10 @@ AND (authtypecode IS NOT NULL AND authtypecode<>\"\")|);
map {$query.= ' and he,ext="'.$_->[1].'"' if ($_->[0]=~/[A-z]/)} $field->subfields();
my ($error,$results)=SimpleSearch($query,"authorityserver");
# there is only 1 result
if ( $error ) {
warn "BIBLIOADDSAUTHORITIES: $error";
return (0,0) ;
}
if ($results && scalar(@$results)==1) {
my $marcrecord = MARC::File::USMARC::decode($results->[0]);
$field->add_subfields('9'=>$marcrecord->field('001')->data);