Bugzilla – Attachment 116765 Details for
Bug 27673
Replace YAML with YAML::XS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27673: Fix encoding issues - Dump
Bug-27673-Fix-encoding-issues---Dump.patch (text/plain), 3.16 KB, created by
Joonas Kylmälä
on 2021-02-11 15:32:37 UTC
(
hide
)
Description:
Bug 27673: Fix encoding issues - Dump
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2021-02-11 15:32:37 UTC
Size:
3.16 KB
patch
obsolete
>From b7a162a4277fce87260bdbb6eef861a31a80725a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 11 Feb 2021 10:52:44 +0100 >Subject: [PATCH] Bug 27673: Fix encoding issues - Dump >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Same as Load, but for Dump. > >Test plan: >Edit ES mappings, replace withdrawn's label with "withdrawn âï¸ â¤ï¸ â" >Export the mappings > perl misc/search_tools/export_elasticsearch_mappings.pl > admin/searchengine/elasticsearch/mappings.yaml >Reset mappings from the UI >=> Notice that the label is correct > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> >--- > misc/migration_tools/bulkmarcimport.pl | 5 +++-- > misc/search_tools/export_elasticsearch_mappings.pl | 3 ++- > reports/reserves_stats.pl | 1 - > 3 files changed, 5 insertions(+), 4 deletions(-) > >diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl >index 86040b6dbe..2fcb968f71 100755 >--- a/misc/migration_tools/bulkmarcimport.pl >+++ b/misc/migration_tools/bulkmarcimport.pl >@@ -16,6 +16,7 @@ use MARC::File::XML; > use MARC::Record; > use MARC::Batch; > use MARC::Charset; >+use Encode; > > use Koha::Script; > use C4::Context; >@@ -565,7 +566,7 @@ if ($logfile){ > } > if ($yamlfile) { > open my $yamlfileout, q{>}, "$yamlfile" or die "cannot open $yamlfile \n"; >- print $yamlfileout YAML::XS::Dump($yamlhash); >+ print $yamlfileout YAML::XS::Dump(Encode::decode_utf8($yamlhash)); > } > exit 0; > >@@ -633,7 +634,7 @@ sub get_heading_fields{ > if ($authtypes){ > $headingfields = YAML::XS::LoadFile($authtypes); > $headingfields={C4::Context->preference('marcflavour')=>$headingfields}; >- $debug && warn YAML::XS::Dump($headingfields); >+ $debug && warn YAML::XS::Dump(Encode::decode_utf8($headingfields)); > } > unless ($headingfields){ > $headingfields=$dbh->selectall_hashref("SELECT auth_tag_to_report, authtypecode from auth_types",'auth_tag_to_report',{Slice=>{}}); >diff --git a/misc/search_tools/export_elasticsearch_mappings.pl b/misc/search_tools/export_elasticsearch_mappings.pl >index a35882cb4f..6e2b158a79 100755 >--- a/misc/search_tools/export_elasticsearch_mappings.pl >+++ b/misc/search_tools/export_elasticsearch_mappings.pl >@@ -52,6 +52,7 @@ Full documentation. > =cut > > use Modern::Perl; >+use Encode; > > use Koha::Script; > use Koha::Database; >@@ -81,4 +82,4 @@ if ( $type && $type !~ /^(marc21|unimarc|normarc)$/ ) { > my $mappings = Koha::SearchEngine::Elasticsearch::raw_elasticsearch_mappings( $type ); > > binmode STDOUT, ":encoding(UTF-8)"; >-print YAML::XS::Dump($mappings); >+print Encode::decode_utf8( YAML::XS::Dump($mappings) ); >diff --git a/reports/reserves_stats.pl b/reports/reserves_stats.pl >index 30ab0628d8..b041b1bf77 100755 >--- a/reports/reserves_stats.pl >+++ b/reports/reserves_stats.pl >@@ -218,7 +218,6 @@ sub calculate { > my @sqlorparams; > my @sqlor; > my @sqlwhere; >- ($debug) and print STDERR YAML::XS::Dump($filters_hashref); > foreach my $filter (keys %$filters_hashref){ > my $string; > my $stringfield=$filter; >-- >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 27673
:
116670
|
116675
|
116694
|
116695
|
116696
|
116737
|
116738
|
116739
|
116740
|
116762
|
116763
|
116764
| 116765 |
116766
|
116778
|
116835
|
116929
|
116990