From 8160a65283f9ca82cc5a33f77b8a6b30b6015702 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 (cherry picked from commit ea1a282b5e2100578354c44d273ba77ede7ae5af) Signed-off-by: Martin Renvoize (cherry picked from commit 247ebf90b226e826c96a85d3912688ccd6cd643a) Signed-off-by: Matt Blenkinsop --- 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 81076216af..55ab81be68 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