Bug 7180: (follow-up) change syspref description
authorJonathan Druart <jonathan.druart@biblibre.com>
Tue, 10 Sep 2013 08:30:25 +0000 (10:30 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Sun, 4 May 2014 19:48:19 +0000 (19:48 +0000)
- the blank line is now useless
- add an example for the syspref value

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
acqui/addorderiso2709.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref

index 84c1ecb..246de8d 100755 (executable)
@@ -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};
index d2c27a9..008d214 100644 (file)
@@ -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:<br/>price: 947$a|947$c<br/>quantity: 969$h<br/>budget_code: 922$a<rb/>"
     Printing:
         -
             - Use the