marc_duplicate now creates duplicate MARC records
git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@580
07558da8-63fa-0310-ba24-
9fe276d99e06
marc_duplicate();
+marc_remove('245');
+
marc('245','a',
rec('230','a')
);
type => $config->{$use_indexer}->{type},
) if ($indexer && $ds);
- $marc->add(
- id => $mfn,
- fields => [ WebPAC::Normalize::_get_marc_fields() ],
- leader => WebPAC::Normalize::marc_leader(),
- row => $row,
- ) if ($marc);
+ if ($marc) {
+ my $i = 0;
+
+ while (my $fields = WebPAC::Normalize::_get_marc_fields( fetch_next => 1 ) ) {
+ $marc->add(
+ id => $mfn . ( $i ? "/$i" : '' ),
+ fields => $fields,
+ leader => WebPAC::Normalize::marc_leader(),
+ row => $row,
+ );
+ $i++;
+ }
+
+ $log->info("Created $i instances of MFN $mfn\n") if ($i > 1);
+ }
$total_rows++;
}