From a251e9dda7fbe1137c5d66e57c1cfe94118941ff Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 1 Sep 2015 09:46:35 +0200 Subject: [PATCH] Bug 14363: OAI-PMH: Handle records without marcxml --- opac/oai.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/opac/oai.pl b/opac/oai.pl index c4f4e8b..2bad067 100755 --- a/opac/oai.pl +++ b/opac/oai.pl @@ -225,7 +225,15 @@ sub new { } my $parser = XML::LibXML->new(); - my $record_dom = $parser->parse_string( $marcxml ); + my $record_dom; + eval { + $record_dom = $parser->parse_string( $marcxml ); + }; + if ($@) { + warn "OAI-PMH: No marcxml for record " . $args{identifier}; + return $self; + } + my $format = $args{metadataPrefix}; if ( $format ne 'marcxml' ) { my %args = ( -- 1.9.1