next; # validation doesn't create any output
}
- my $ds = WebPAC::Normalize::data_structure(
+ if ( my $ds = WebPAC::Normalize::data_structure(
row => $row,
rules => $rules,
lookup => $lookup_hash,
id => $mfn,
);
},
- );
+ ) ) { # if
- $log->debug("ds = ", sub { dump($ds) }) if ($ds);
-
- $store->save_ds(
- database => $database,
- input => $input_name,
- id => $mfn,
- ds => $ds,
- ) if ($ds && !$stats);
-
- $indexer->add(
- id => "${input_name}/${mfn}",
- ds => $ds,
- type => $config->get($indexer_config)->{type},
- ) if ($indexer && $ds);
-
- 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::_get_marc_leader(),
- row => $row,
- );
- $i++;
+ $log->debug("ds = ", sub { dump($ds) });
+
+ $store->save_ds(
+ database => $database,
+ input => $input_name,
+ id => $mfn,
+ ds => $ds,
+ ) if !$stats;
+
+ $indexer->add(
+ id => "${input_name}/${mfn}",
+ ds => $ds,
+ type => $config->get($indexer_config)->{type},
+ ) if $indexer;
+
+ 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::_get_marc_leader(),
+ row => $row,
+ );
+ $i++;
+ }
+
+ $log->info("Created $i instances of MFN $mfn\n") if ($i > 1);
}
- $log->info("Created $i instances of MFN $mfn\n") if ($i > 1);
- }
+ foreach my $out ( @output_modules ) {
+ $out->add( $mfn, $ds ) if $out->can('add');
+ }
- foreach my $out ( @output_modules ) {
- $out->add( $mfn, $ds ) if $out->can('add');
+ } else {
+ $log->warn("record $pos didn't produce any output after normalization rules!");
}
}