rebuild_zebra now handle correctly improper authorities records

(missing 100 field are automatically added)

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Paul POULAIN 2007-11-06 11:55:38 -06:00 committed by Joshua Ferraro
parent dbafe27e62
commit b7eb9e1b5c
1 changed files with 4 additions and 1 deletions

View File

@ -299,8 +299,11 @@ rank:rank-1
eval {
$record = GetAuthority($authid);
};
next unless $record;
# force authid in case it's not here, otherwise, zebra will die on this authority
unless ($record->field('001')){
unless ($record->field('001')->data() eq $authid){
print "$authid don't exist for this authority :".$record->as_formatted;
$record->delete_field($record->field('001'));
$record->insert_fields_ordered(MARC::Field->new('001',$authid));
}
if($@){