Bug 5683 - it is possible to save corrupt records
This patch makes it impossible to save records with variables fields that don't
contain any subfields. Prior to this patch, link_bibs_to_authorities.pl would
sometimes corrupt records.
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit 428556cd13)
Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
parent
5ab83557b5
commit
2db0ea15f7
|
|
@ -325,6 +325,14 @@ sub ModBiblio {
|
|||
$record->append_fields($field);
|
||||
}
|
||||
|
||||
foreach my $field ($record->fields()) {
|
||||
if (! $field->is_control_field()) {
|
||||
if (scalar($field->subfields()) == 0) {
|
||||
$record->delete_fields($field);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# update biblionumber and biblioitemnumber in MARC
|
||||
# FIXME - this is assuming a 1 to 1 relationship between
|
||||
# biblios and biblioitems
|
||||
|
|
|
|||
Loading…
Reference in New Issue