From 224851f60a0309bd245cb344a87f72ae7d808024 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 10 Sep 2013 10:30:25 +0200 Subject: [PATCH] Bug 7180: Change syspref description - the blank line is now useless - add an example for the syspref value --- acqui/addorderiso2709.pl | 9 ++++++++- .../prog/en/modules/admin/preferences/acquisitions.pref | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index e25df0d..78e8fd5 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -492,7 +492,14 @@ sub add_matcher_list { sub get_infos_syspref { my ($record, $field_list) = @_; my $syspref = C4::Context->preference('MarcFieldsToOrder'); - my $yaml = YAML::Load($syspref); + $syspref = "$syspref\n\n"; # YAML is anal on ending \n. Surplus does not hurt + my $yaml = eval { + YAML::Load($syspref); + }; + if ( $@ ) { + warn "Unable to parse MarcFieldsToOrder syspref : $@"; + return (); + } my $r; for my $field_name ( @$field_list ) { my @fields = split /\|/, $yaml->{$field_name}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref index 4c9dc46..7cec442 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref @@ -43,10 +43,10 @@ Acquisitions: no: "Do not warn" - when the librarian tries to create an invoice with a duplicate number. - - - Set the mapping values for a new order line created from a marcrecord (staged file). In a YAML format, so you have to finished with an empty line. + - Set the mapping values for a new order line created from a marcrecord (staged file). - pref: MarcFieldsToOrder type: textarea - + - "For example:
price: 947$a|947$c
quantity: 969$h
budget_code: 922$a" Printing: - - Use -- 1.7.10.4