From 0b8f1799a05911e59db1b48701f9a1911e5f2eed Mon Sep 17 00:00:00 2001 From: dbs Date: Mon, 7 Mar 2011 19:30:04 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.open-ils.org/ILS/trunk@19626 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/support-scripts/marc_export | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/Open-ILS/src/support-scripts/marc_export b/Open-ILS/src/support-scripts/marc_export index ecd79a5..3fe5ec1 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') { -- 1.7.2.5