From ea1a282b5e2100578354c44d273ba77ede7ae5af Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 11 Jul 2023 13:59:50 +0000 Subject: [PATCH] Bug 33270: (follow-up) Handle records that fail attempt to ignore bad characters Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- Koha/OAI/Server/ListBase.pm | 9 +++++++++ koha-tmpl/opac-tmpl/xslt/OAI.xslt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Koha/OAI/Server/ListBase.pm b/Koha/OAI/Server/ListBase.pm index 6fd2891050..0c4f3a8545 100644 --- a/Koha/OAI/Server/ListBase.pm +++ b/Koha/OAI/Server/ListBase.pm @@ -170,6 +170,15 @@ sub GetRecords { %params ) ); + } elsif ($marcxml_error) { + my $record = MARC::Record->new(); + my $marcxml = $record->as_xml_record(); + $self->record( + Koha::OAI::Server::Record->new( + $repository, $marcxml, $timestamp, \@setSpecs, + %params + ) + ); } else { $self->record( Koha::OAI::Server::DeletedRecord->new( diff --git a/koha-tmpl/opac-tmpl/xslt/OAI.xslt b/koha-tmpl/opac-tmpl/xslt/OAI.xslt index e81eda8a31..47125e24c0 100644 --- a/koha-tmpl/opac-tmpl/xslt/OAI.xslt +++ b/koha-tmpl/opac-tmpl/xslt/OAI.xslt @@ -349,7 +349,7 @@ - There was a problem decoding the metadata for this record, invalid characters were stripped. See system logs for details + There was a problem decoding the metadata for this record, an attempt was made to ignore invalid characters, the metadata view may be degraded. See system logs for details -- 2.39.5