Bugzilla – Attachment 100694 Details for
Bug 24827
MARC preview fails when staged record contains items with UTF-8 characters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24827: Standardise on 'UTF-8' as the encoding name
Bug-24827-Standardise-on-UTF-8-as-the-encoding-nam.patch (text/plain), 5.15 KB, created by
Andreas Roussos
on 2020-03-15 07:49:40 UTC
(
hide
)
Description:
Bug 24827: Standardise on 'UTF-8' as the encoding name
Filename:
MIME Type:
Creator:
Andreas Roussos
Created:
2020-03-15 07:49:40 UTC
Size:
5.15 KB
patch
obsolete
>From ba3a2396f2395d33bdbddc5fee4761c31f31ea44 Mon Sep 17 00:00:00 2001 >From: Andreas Roussos <a.roussos@dataly.gr> >Date: Sun, 15 Mar 2020 08:34:52 +0100 >Subject: [PATCH] Bug 24827: Standardise on 'UTF-8' as the encoding name > >This patch standardises the encoding name used in direct calls >to new_from_xml() to 'UTF-8' instead of 'utf8' or 'utf-8'. >--- > C4/Biblio.pm | 2 +- > Koha/Biblio/Metadata.pm | 2 +- > misc/batchRebuildBiblioTables.pl | 2 +- > misc/migration_tools/build_oai_sets.pl | 2 +- > opac/opac-readingrecord.pl | 2 +- > svc/bib | 2 +- > svc/import_bib | 2 +- > svc/new_bib | 2 +- > 8 files changed, 8 insertions(+), 8 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index f745b93d32..60bdc8980a 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -1158,7 +1158,7 @@ sub GetMarcBiblio { > > if ($marcxml) { > $record = eval { >- MARC::Record::new_from_xml( $marcxml, "utf8", >+ MARC::Record::new_from_xml( $marcxml, "UTF-8", > C4::Context->preference('marcflavour') ); > }; > if ($@) { warn " problem with :$biblionumber : $@ \n$marcxml"; } >diff --git a/Koha/Biblio/Metadata.pm b/Koha/Biblio/Metadata.pm >index bdc1435b5a..b43a04bdb2 100644 >--- a/Koha/Biblio/Metadata.pm >+++ b/Koha/Biblio/Metadata.pm >@@ -67,7 +67,7 @@ sub record { > my $record; > > if ( $self->format eq 'marcxml' ) { >- $record = eval { MARC::Record::new_from_xml( $self->metadata, 'utf-8', $self->schema ); }; >+ $record = eval { MARC::Record::new_from_xml( $self->metadata, 'UTF-8', $self->schema ); }; > my $marcxml_error = $@; > chomp $marcxml_error; > unless ($record) { >diff --git a/misc/batchRebuildBiblioTables.pl b/misc/batchRebuildBiblioTables.pl >index 15f650377a..edc7c16d33 100755 >--- a/misc/batchRebuildBiblioTables.pl >+++ b/misc/batchRebuildBiblioTables.pl >@@ -63,7 +63,7 @@ while (my ($biblionumber, $frameworkcode) = $sth->fetchrow) { > > $marcxml = C4::Charset::StripNonXmlChars( $marcxml ); > my $record = eval { >- MARC::Record::new_from_xml($marcxml, 'utf8', $marcflavour); >+ MARC::Record::new_from_xml($marcxml, 'UTF-8', $marcflavour); > }; > if ($@) { > push @errors, $biblionumber; >diff --git a/misc/migration_tools/build_oai_sets.pl b/misc/migration_tools/build_oai_sets.pl >index a19cc4c025..64addad2ce 100755 >--- a/misc/migration_tools/build_oai_sets.pl >+++ b/misc/migration_tools/build_oai_sets.pl >@@ -121,7 +121,7 @@ foreach my $res (@$results) { > MARC::File::XML->default_record_format(C4::Context->preference('marcflavour')); > my $record; > eval { >- $record = MARC::Record::new_from_xml($marcxml, "utf8", C4::Context->preference('marcflavour')); >+ $record = MARC::Record::new_from_xml($marcxml, "UTF-8", C4::Context->preference('marcflavour')); > }; > if($@) { > warn "(biblio $biblionumber) Error while creating record from marcxml: $@"; >diff --git a/opac/opac-readingrecord.pl b/opac/opac-readingrecord.pl >index 0e7a33a44a..c13faacaa3 100755 >--- a/opac/opac-readingrecord.pl >+++ b/opac/opac-readingrecord.pl >@@ -97,7 +97,7 @@ foreach my $issue ( @{$issues} ) { > if ( $marcxml ) { > $marcxml = StripNonXmlChars( $marcxml ); > my $marc_rec = >- MARC::Record::new_from_xml( $marcxml, 'utf8', >+ MARC::Record::new_from_xml( $marcxml, 'UTF-8', > C4::Context->preference('marcflavour') ); > $issue->{normalized_upc} = GetNormalizedUPC( $marc_rec, C4::Context->preference('marcflavour') ); > } >diff --git a/svc/bib b/svc/bib >index 50580e820e..11cc260916 100755 >--- a/svc/bib >+++ b/svc/bib >@@ -90,7 +90,7 @@ sub update_bib { > my $inxml = $query->param('POSTDATA'); > print $query->header(-type => 'text/xml', -charset => 'utf-8'); > >- my $record = eval {MARC::Record::new_from_xml( $inxml, "utf8", C4::Context->preference('marcflavour'))}; >+ my $record = eval {MARC::Record::new_from_xml( $inxml, "UTF-8", C4::Context->preference('marcflavour'))}; > my $do_not_escape = 0; > if ($@) { > $result->{'status'} = "failed"; >diff --git a/svc/import_bib b/svc/import_bib >index 8577036ed9..3073463893 100755 >--- a/svc/import_bib >+++ b/svc/import_bib >@@ -73,7 +73,7 @@ sub import_bib { > } > > my $marcflavour = C4::Context->preference('marcflavour') || 'MARC21'; >- my $marc_record = eval {MARC::Record::new_from_xml( $inxml, "utf8", $marcflavour)}; >+ my $marc_record = eval {MARC::Record::new_from_xml( $inxml, "UTF-8", $marcflavour)}; > if ($@) { > $result->{'status'} = "failed"; > $result->{'error'} = $@; >diff --git a/svc/new_bib b/svc/new_bib >index d9586dd855..c41d298b2c 100755 >--- a/svc/new_bib >+++ b/svc/new_bib >@@ -54,7 +54,7 @@ sub add_bib { > print $query->header(-type => 'text/xml', -charset => 'utf-8'); > > my $marcflavour = C4::Context->preference('marcflavour') || 'MARC21'; >- my $record = eval {MARC::Record::new_from_xml( $inxml, "utf8", $marcflavour)}; >+ my $record = eval {MARC::Record::new_from_xml( $inxml, "UTF-8", $marcflavour)}; > my $do_not_escape = 0; > if ($@) { > $result->{'status'} = "failed"; >-- >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 24827
:
100313
|
100314
|
100315
|
100320
|
100410
|
100694
|
100695
|
100737
|
100738
|
100739