Bug 10684: make sure that Koha search does not dies on undecodable records
When a record fails to decode during a search, Koha dies with an error. Koha should ignore bad records and continue on ( and log the error ). An example of a record that Zebra will happily ingest but which MARC::Record doesn't like is one that contains a punctuation character in a tag label. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
parent
7e6364baee
commit
6a78fad4e0
|
|
@ -1699,7 +1699,10 @@ sub searchResults {
|
|||
|
||||
# loop through all of the records we've retrieved
|
||||
for ( my $i = $offset ; $i <= $times - 1 ; $i++ ) {
|
||||
my $marcrecord = MARC::File::USMARC::decode( $marcresults->[$i] );
|
||||
my $marcrecord = eval { MARC::File::USMARC::decode( $marcresults->[$i] ) };
|
||||
warn "ERROR DECODING RECORD - $@: " . $marcresults->[$i] if $@;
|
||||
next if $@;
|
||||
|
||||
my $fw = $scan
|
||||
? undef
|
||||
: $bibliotag < 10
|
||||
|
|
|
|||
Loading…
Reference in New Issue