From b9619a485efbb209fecbf6bc7bb8b0ecd7091c98 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 10 Sep 2013 10:30:25 +0200 Subject: [PATCH] Bug 7180: (follow-up) change syspref description - the blank line is now useless - add an example for the syspref value Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer Signed-off-by: Galen Charlton --- 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 84c1ecb2ea..246de8d436 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 d2c27a9c64..008d2143f0 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 @@ -46,10 +46,10 @@ Acquisitions: - Upon receiving items, update their subfields if they were created when placing an order (e.g. o=5|a="foo bar"). - pref: AcqItemSetSubfieldsWhenReceived - - - 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 the -- 2.39.5