From 9cde768369a9a8af21f3720dbf7badf1c57a3a7a Mon Sep 17 00:00:00 2001 From: toins Date: Tue, 19 Jun 2007 15:58:23 +0000 Subject: [PATCH] oups... It can be more than one ISBN.... fixed now. --- misc/bulkupdate.pl | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/misc/bulkupdate.pl b/misc/bulkupdate.pl index 0ecd12ed02..2e0e39f0c5 100644 --- a/misc/bulkupdate.pl +++ b/misc/bulkupdate.pl @@ -110,18 +110,19 @@ if(not $process_marcxml){ eval{ my $record = MARC::Record->new_from_xml($marcxml,'UTF-8'); - my $field = $record->field('010'); - my $subfield = $field->subfield('a'); - if($subfield){ - my $isbn = $subfield; - $isbn =~ s/\-//g; - $field->update('a' => $isbn); - $marcxml = $record->as_xml('UTF-8'); - - # Update - my $sth = $dbh->prepare($update_marcxml); - $sth->execute($marcxml,$biblioitemnumber); - } + my @field = $record->field('010'); + foreach my $field (@field){ + my $subfield = $field->subfield('a'); + if($subfield){ + my $isbn = $subfield; + $isbn =~ s/\-//g; + $field->update('a' => $isbn); + } + } + $marcxml = $record->as_xml('UTF-8'); + # Update + my $sth = $dbh->prepare($update_marcxml); + $sth->execute($marcxml,$biblioitemnumber); }; if($@){ print "\n /!\\ pb getting $biblioitemnumber : $@"; -- 2.39.5