From b7eb9e1b5c4977d3e71eaa663be2b8f4f3b67fd4 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Tue, 6 Nov 2007 11:55:38 -0600 Subject: [PATCH] rebuild_zebra now handle correctly improper authorities records (missing 100 field are automatically added) Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- misc/migration_tools/rebuild_zebra.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl index 39679a8263..b6cee7d476 100755 --- a/misc/migration_tools/rebuild_zebra.pl +++ b/misc/migration_tools/rebuild_zebra.pl @@ -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($@){ -- 2.39.5