From 457c948ad003d23c249e2990de750c2aaab418ec Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 6 Apr 2023 10:55:41 -0300 Subject: [PATCH] Bug 33431: Make C4::Record use C4::Context->yaml_preference This patch makes what the title says. To test: 1. Run: $ ktd --shell k$ prove t/db_dependent/Rec* => SUCCESS: Tests pass 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests pass! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: David Nind Signed-off-by: Pedro Amorim Signed-off-by: Katrin Fischer --- C4/Record.pm | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/C4/Record.pm b/C4/Record.pm index 799499ec86..29f105a9f1 100644 --- a/C4/Record.pm +++ b/C4/Record.pm @@ -794,16 +794,7 @@ sub marc2bibtex { ); } - my $BibtexExportAdditionalFields = C4::Context->preference('BibtexExportAdditionalFields'); - my $additional_fields; - if ($BibtexExportAdditionalFields) { - $BibtexExportAdditionalFields = "$BibtexExportAdditionalFields\n\n"; - $additional_fields = eval { YAML::XS::Load(Encode::encode_utf8($BibtexExportAdditionalFields)); }; - if ($@) { - warn "Unable to parse BibtexExportAdditionalFields : $@"; - $additional_fields = undef; - } - } + my $additional_fields = C4::Context->yaml_preference('BibtexExportAdditionalFields'); if ( $additional_fields && $additional_fields->{'@'} ) { my ( $f, $sf ) = split( /\$/, $additional_fields->{'@'} ); -- 2.39.5