From 34fe5c24167f6bc27cff519d4a26c347d06341b3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 24 Apr 2015 17:03:09 +0200 Subject: [PATCH] Bug 11790: Remove dependency C4::Context from C4::Charset C4::Context is only used to retrieve a syspref value. This patch moves the use of C4::Context to a require. Test plan: Try to reach the SetMarcUnicodeFlag subroutine (batchmod, add/update a biblio, etc.) Signed-off-by: Bernardo Gonzalez Kriegel Tested on French UNIMARC install No errors adding/editing biblios No koha-qa errors Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- C4/Charset.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Charset.pm b/C4/Charset.pm index 41a8d83fa5..667c2d2ec8 100644 --- a/C4/Charset.pm +++ b/C4/Charset.pm @@ -22,7 +22,6 @@ use warnings; use MARC::Charset qw/marc8_to_utf8/; use Text::Iconv; -use C4::Context; use C4::Debug; use Unicode::Normalize; use Encode qw( decode encode is_utf8 ); @@ -333,6 +332,7 @@ sub SetMarcUnicodeFlag { substr($leader, 9, 1) = 'a'; $marc_record->leader($leader); } elsif ($marc_flavour =~/UNIMARC/) { + require C4::Context; my $defaultlanguage = C4::Context->preference("UNIMARCField100Language"); $defaultlanguage = "fre" if (!$defaultlanguage || length($defaultlanguage) != 3); my $string; -- 2.39.5