From: gmc Date: Wed, 20 Apr 2011 14:50:14 +0000 (+0000) Subject: Create a 001 field if it doesn't exist in marc_export X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5ec03104199e6c3dbb700f28c0b977e4e75a99ec;p=evergreen%2Ftadl.git Create a 001 field if it doesn't exist in marc_export Real data has a way of surprising you sometimes, like by not having 001 fields. Signed-off-by: Galen Charlton git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_1@20241 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/support-scripts/marc_export b/Open-ILS/src/support-scripts/marc_export index ecd79a5892..3fe5ec1816 100755 --- a/Open-ILS/src/support-scripts/marc_export +++ b/Open-ILS/src/support-scripts/marc_export @@ -278,7 +278,12 @@ sub export_record { if ($replace_001) { my $tcn = $r->field('001'); - $tcn->update($id); + if ($tcn) { + $tcn->update($id); + } else { + my $new_001 = MARC::Field->new('001', $id); + $r->insert_fields_ordered($new_001); + } } if ($format eq 'XML') {