@@ -, +, @@ - 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(-) --- a/acqui/addorderiso2709.pl +++ a/acqui/addorderiso2709.pl @@ -490,7 +490,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}; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref @@ -46,10 +46,10 @@ Acquisitions: - pref: AcqItemSetSubfieldsWhenReceived - Set subfields for item when items are created when receiving (e.g. o=5|a="foo bar") - - - 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 --