]> git.imager.perl.org - bse.git/commitdiff
allow all newvalue<digits> fields on product option edit
authorTony Cook <tony@develop-help.com>
Tue, 21 Apr 2020 09:44:00 +0000 (19:44 +1000)
committerTony Cook <tony@develop-help.com>
Tue, 21 Apr 2020 09:44:00 +0000 (19:44 +1000)
site/cgi-bin/modules/BSE/Edit/Product.pm

index d90ce205eab56ad53b40706f29af247d159c6695..ecbf929045b59773f60339d067764c9b41d3bf3b 100644 (file)
@@ -11,7 +11,7 @@ use BSE::Util::Tags qw(tag_hash tag_article);
 use BSE::PubSub;
 use constant PRODUCT_CUSTOM_FIELDS_CFG => "product custom fields";
 
-our $VERSION = "1.018";
+our $VERSION = "1.019";
 
 =head1 NAME
 
@@ -1033,8 +1033,8 @@ sub req_save_option {
 
   my @new_values;
   my $index = 1;
-  while ($index < 10 && defined $cgi->param("newvalue$index")) {
-    my $field = "newvalue$index";
+  my @newvalue_fields = grep /^newvalue[1-9][0-9]*$/, $cgi->param;
+  for my $field (@newvalue_fields) {
     my $value = $cgi->param($field);
     $req->validate(fields => { $field => \%option_value },
                   errors => \%errors);