From 5f59c30c9f3c50229c85fd34bbedbe5b75c07310 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 29 Oct 2020 12:18:56 +0000 Subject: [PATCH] Bug 18051: Set UTF8 Flag for record searches/imports from rancor The advanced cataloging editor uses Koha::MetaSearcher to find and import records from Z3950. The records are correctly converted to UTF8, however, we need to set the flag in the record to ensure they are parsed correctly later To test: 1 - Add OHIOLINK as a z39 source as described in earlier comments 2 - Browse to Cataloging->Advanced editor 3 - Click Search->Advanced 4 - Select OHIOLINK 5 - Search for author 'capek karel' 6 - Note records look bad 7 - Apply patch 8 - Restart all the things 9 - Repeat 10 - Success! Signed-off-by: Barbara Johnson Signed-off-by: Katrin Fischer Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart (cherry picked from commit 4d92e3d284e392ad681b095c02965fe57a85a5a1) Signed-off-by: Lucas Gass (cherry picked from commit 5b5c58e08b04fa6c329d30d834329194ffd422bf) Signed-off-by: Aleisha Amohia (cherry picked from commit b5121e77fe703df81942cdac89829bf6848829db) Signed-off-by: Victor Grousset/tuxayo --- Koha/MetaSearcher.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Koha/MetaSearcher.pm b/Koha/MetaSearcher.pm index 280d1b24c0..eed243735d 100644 --- a/Koha/MetaSearcher.pm +++ b/Koha/MetaSearcher.pm @@ -21,7 +21,7 @@ use Modern::Perl; use base 'Class::Accessor'; -use C4::Charset qw( MarcToUTF8Record ); +use C4::Charset qw( MarcToUTF8Record SetUTF8Flag ); use C4::Search qw(); # Purely for new_record_from_zebra use DBIx::Class::ResultClass::HashRefInflator; use IO::Select; @@ -298,6 +298,7 @@ sub _import_record { my ( $marcrecord ) = MarcToUTF8Record( $raw, $marcflavour, $encoding ); #ignores charset return values + SetUTF8Flag($marcrecord); return $marcrecord; } -- 2.39.5