Bugzilla – Attachment 96160 Details for
Bug 24123
bulkmarcimport.pl doesn't support UTF-8 encoded MARCXML records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24123: Fix import of UTF-8 encoded MARC21 MARCXML using bulkmarcimport (elastic only)
Bug-24123-Fix-import-of-UTF-8-encoded-MARC21-MARCX.patch (text/plain), 2.54 KB, created by
Jonathan Druart
on 2019-12-10 14:32:18 UTC
(
hide
)
Description:
Bug 24123: Fix import of UTF-8 encoded MARC21 MARCXML using bulkmarcimport (elastic only)
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-12-10 14:32:18 UTC
Size:
2.54 KB
patch
obsolete
>From 9ff3573b4d2c2dfc43529c59a17c4bdfbaa65a2d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 10 Dec 2019 15:24:36 +0100 >Subject: [PATCH] Bug 24123: Fix import of UTF-8 encoded MARC21 MARCXML using > bulkmarcimport (elastic only) > >If elastic is used as search engine, the bulkmarcimport.pl will not >handle correctly UTF-8 encoded MARCXML > >Koha::SearchEngine::Search->new uses a require statement to load the correct Search module. >This is done l.257 of bulkmarcimport.pl: > 257 my $searcher = Koha::SearchEngine::Search->new > >Koha::SearchEngine::Elasticsearch::Search will `use MARC::File::XML`, and so resets the arguments set before: > 216 $MARC::File::XML::_load_args{BinaryEncoding} = 'utf-8'; > > 220 $MARC::File::XML::_load_args{RecordFormat} = $recordformat; > >An easy (but dirty) fix could be to move the declaration of my $searcher before in the script. >The tricky (but correct) fix would be to remove the long standing "ugly hack follows" comment. > >This patch is the easy, and dirty, fix > >Test plan: >Use the command line tool to import MARXCML records that contains unicode characters into Koha > >Something like `misc/migration_tools/bulkmarcimport.pl -biblios -file record.marcxml -m=MARCXML` > >Without this patch you will notice that unicode characters will not be displayed correctly >--- > misc/migration_tools/bulkmarcimport.pl | 21 +++++++++++---------- > 1 file changed, 11 insertions(+), 10 deletions(-) > >diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl >index bc438aac38..a441c071fa 100755 >--- a/misc/migration_tools/bulkmarcimport.pl >+++ b/misc/migration_tools/bulkmarcimport.pl >@@ -199,6 +199,17 @@ if ($test_parameter) { > > my $marcFlavour = C4::Context->preference('marcflavour') || 'MARC21'; > >+# The definition of $searcher must be before MARC::Batch->new >+my $searcher = Koha::SearchEngine::Search->new( >+ { >+ index => ( >+ $authorities >+ ? $Koha::SearchEngine::AUTHORITIES_INDEX >+ : $Koha::SearchEngine::BIBLIOS_INDEX >+ ) >+ } >+); >+ > print "Characteristic MARC flavour: $marcFlavour\n" if $verbose; > my $starttime = gettimeofday; > my $batch; >@@ -254,16 +265,6 @@ if ($logfile){ > print $loghandle "id;operation;status\n"; > } > >-my $searcher = Koha::SearchEngine::Search->new( >- { >- index => ( >- $authorities >- ? $Koha::SearchEngine::AUTHORITIES_INDEX >- : $Koha::SearchEngine::BIBLIOS_INDEX >- ) >- } >-); >- > RECORD: while ( ) { > my $record; > # get records >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24123
:
96160
|
96967
|
97138