From d3171c85f0563786c80fab5cad5de272096be0be Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 10 Sep 2013 10:30:25 +0200 Subject: [PATCH] [PASSED QA] Bug 7180: 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 --- 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 84c1ecb..246de8d 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 d2c27a9..008d214 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 -- 1.8.3.2