Bug 5354 follow-up : dealing with a wrong regexp
authorPaul Poulain <paul.poulain@biblibre.com>
Wed, 28 Mar 2012 14:17:45 +0000 (16:17 +0200)
committerPaul Poulain <paul.poulain@biblibre.com>
Wed, 28 Mar 2012 14:17:45 +0000 (16:17 +0200)
I could not reproduce the working behaviour when I found that the tiny follow-up introduced a bug
| being a reserved char in regexp, split '|' is not splitting on '|' ! we must write '\|' !

serials/subscription-add.pl

index b0f3625..0a33875 100755 (executable)
@@ -115,7 +115,7 @@ if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') {
 
     if ( $op eq 'dup' ) {
         my $dont_copy_fields = C4::Context->preference('SubscriptionDuplicateDroppedInput');
-        my @fields_id = map { fieldid => $_ }, split '|', $dont_copy_fields;
+        my @fields_id = map { fieldid => $_ }, split '\|', $dont_copy_fields;
         $template->param( dont_export_field_loop => \@fields_id );
     }
 }