Bugzilla – Attachment 3838 Details for
Bug 6145
ModBiblio double encoding items information
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
0001-Bug-6145-ModBiblio-double-encoding-items-information.patch (text/plain), 2.19 KB, created by
Julian Maurice
on 2011-04-08 12:41:07 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2011-04-08 12:41:07 UTC
Size:
2.19 KB
patch
obsolete
>From ca14f04902978c44138734f9ce099afb56656f08 Mon Sep 17 00:00:00 2001 >From: Henri-Damien LAURENT <henridamien.laurent@biblibre.com> >Date: Mon, 15 Nov 2010 19:18:37 +0100 >Subject: [PATCH] Bug 6145: ModBiblio : double encoding items information > >diacritics would be double encoded when using ModBiblio multiple times on the same biblio. >this patch fixes that. >--- > C4/Biblio.pm | 33 +++++++++++++++++---------------- > 1 files changed, 17 insertions(+), 16 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 135dd91..3cc7fb1 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -317,22 +317,23 @@ sub ModBiblio { > # strange, I (Paul P.) searched more than 1 day to understand what happends > # but could only solve the problem this way... > my @fields = $oldRecord->field($itemtag); >- foreach my $fielditem (@fields) { >- my $field; >- foreach ( $fielditem->subfields() ) { >- # re-encode the subfield only if it isn't already in utf-8. >- my ($tag, $value) = @$_; >- $tag = Encode::encode('utf-8', $tag) unless utf8::is_utf8($tag); >- $value = Encode::encode('utf-8', $value) unless utf8::is_utf8($value); >- >- if ($field) { >- $field->add_subfields( $tag => $value ); >- } else { >- $field = MARC::Field->new( "$itemtag", '', '', $tag => $value ); >- } >- } >- $record->append_fields($field); >- } >+ $record->append_fields(@fields); >+# foreach my $fielditem (@fields) { >+# my $field; >+# foreach ( $fielditem->subfields() ) { >+# # re-encode the subfield only if it isn't already in utf-8. >+# my ($tag, $value) = @$_; >+# $tag = Encode::encode('utf-8', $tag) unless utf8::is_utf8($tag); >+# $value = Encode::encode('utf-8', $value) unless utf8::is_utf8($value); >+# >+# if ($field) { >+# $field->add_subfields( $tag => $value ); >+# } else { >+# $field = MARC::Field->new( "$itemtag", '', '', $tag => $value ); >+# } >+# } >+# $record->append_fields($field); >+# } > > foreach my $field ($record->fields()) { > if (! $field->is_control_field()) { >-- >1.7.4.1 >
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 6145
: 3838