--- trunk/run.pl 2007/10/31 13:31:12 941 +++ trunk/run.pl 2007/11/02 10:54:42 956 @@ -543,7 +543,7 @@ 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, @@ -557,41 +557,45 @@ id => $mfn, ); }, - ); + ) ) { # if - $log->debug("ds = ", sub { dump($ds) }) if ($ds); + $log->debug("ds = ", sub { dump($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++; + $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!"); } }