Bugzilla – Attachment 13897 Details for
Bug 8347
Koha forces UNIMARC 100 field code language to 'fre'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
BUG - Koha forces UNIMARC 100 field code language to 'fre'
BUG---Koha-forces-UNIMARC-100-field-code-language-.patch (text/plain), 2.26 KB, created by
Vitor Fernandes
on 2012-12-05 15:36:08 UTC
(
hide
)
Description:
BUG - Koha forces UNIMARC 100 field code language to 'fre'
Filename:
MIME Type:
Creator:
Vitor Fernandes
Created:
2012-12-05 15:36:08 UTC
Size:
2.26 KB
patch
obsolete
>From 40c30f95c8ade7f26e0bf0c3e83f221eea80ec27 Mon Sep 17 00:00:00 2001 >From: Vitor FERNANDES <vfernandes@keep.pt> >Date: Wed, 5 Dec 2012 15:34:24 +0000 >Subject: [PATCH] BUG - Koha forces UNIMARC 100 field code language to 'fre' > >Changed Charset.pm to use defaultlanguage instead of 'fre'. > >http://bugs.koha-community.org/show_bug.cgi?id=8347 >--- > C4/Charset.pm | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > >diff --git a/C4/Charset.pm b/C4/Charset.pm >index c294b36..163f959 100644 >--- a/C4/Charset.pm >+++ b/C4/Charset.pm >@@ -324,8 +324,10 @@ sub SetMarcUnicodeFlag { > substr($leader, 9, 1) = 'a'; > $marc_record->leader($leader); > } elsif ($marc_flavour =~/UNIMARC/) { >+ my $defaultlanguage = C4::Context->preference("UNIMARCField100Language"); >+ $defaultlanguage = "fre" if (!$defaultlanguage || length($defaultlanguage) != 3); > my $string; >- my ($subflength,$encodingposition)=($marc_flavour=~/AUTH/?(21,9):(36,22)); >+ my ($subflength,$encodingposition)=($marc_flavour=~/AUTH/?(21,12):(36,25)); > $string=$marc_record->subfield( 100, "a" ); > if (defined $string && length($string)==$subflength) { > $string = substr $string, 0,$subflength if (length($string)>$subflength); >@@ -333,9 +335,10 @@ sub SetMarcUnicodeFlag { > else { > $string = POSIX::strftime( "%Y%m%d", localtime ); > $string =~ s/\-//g; >- $string = sprintf( "%-*s", $subflength, $string ); >+ $string = sprintf( "%-*s", $subflength, $string ); >+ substr ( $string, ($encodingposition - 3), 3, $defaultlanguage); > } >- substr( $string, $encodingposition, 8, "frey50 " ); >+ substr( $string, $encodingposition, 3, "y50" ); > if ( $marc_record->subfield( 100, "a" ) ) { > $marc_record->field('100')->update(a=>$string); > } >@@ -343,7 +346,7 @@ sub SetMarcUnicodeFlag { > $marc_record->insert_grouped_field( > MARC::Field->new( 100, '', '', "a" => $string ) ); > } >- $debug && warn "encodage: ", substr( $marc_record->subfield(100, 'a'), $encodingposition, 8 ); >+ $debug && warn "encodage: ", substr( $marc_record->subfield(100, 'a'), $encodingposition, 3 ); > } else { > warn "Unrecognized marcflavour: $marc_flavour"; > } >-- >1.7.9.5
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 8347
:
13761
|
13883
|
13897
|
15483
|
15484
|
15485