From f4d64b15fc18347138e8c6edd78c02dd23e5a44a Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 5 Aug 2013 09:28:19 -0400 Subject: [PATCH] Bug 10684 - Koha search 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 ). --- C4/Search.pm | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index aec024b..74536ea 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1698,7 +1698,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 -- 1.7.2.5