avoid croak on latest CVS version of MARC::Record
The semantics of MARC::Record->delete_field() changed slightly in the latest CVS version of MARC::Record. delete_field() will now croak if passed an undef scalar, while the version of MARC::Record from CPAN accepts that input. Since some packages of MARC::Record in the wild appear to be based on the CVS version, not the CPAN version, added a check where needed to avoid the croak. Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
dd80cb4f2a
commit
6a0a4e3900
|
|
@ -2441,7 +2441,7 @@ sub _koha_marc_update_bib_ids {
|
|||
|
||||
# drop old field and create new one...
|
||||
$old_field = $record->field($biblio_tag);
|
||||
$record->delete_field($old_field);
|
||||
$record->delete_field($old_field) if $old_field;
|
||||
$record->append_fields($new_field);
|
||||
|
||||
# deal with biblioitemnumber
|
||||
|
|
@ -2454,7 +2454,7 @@ sub _koha_marc_update_bib_ids {
|
|||
}
|
||||
# drop old field and create new one...
|
||||
$old_field = $record->field($biblioitem_tag);
|
||||
$record->delete_field($old_field);
|
||||
$record->delete_field($old_field) if $old_field;
|
||||
$record->insert_fields_ordered($new_field);
|
||||
|
||||
} else {
|
||||
|
|
@ -2467,7 +2467,7 @@ sub _koha_marc_update_bib_ids {
|
|||
|
||||
# drop old field and create new one...
|
||||
my $old_field = $record->field($biblio_tag);
|
||||
$record->delete_field($old_field);
|
||||
$record->delete_field($old_field) if $old_field;
|
||||
$record->insert_fields_ordered($new_field);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue