From: Tony Cook Date: Tue, 21 Apr 2020 09:44:00 +0000 (+1000) Subject: allow all newvalue fields on product option edit X-Git-Url: http://git.imager.perl.org/bse.git/commitdiff_plain/d456aa2168b520f96e9c65802baeb1889f18b478 allow all newvalue fields on product option edit --- diff --git a/site/cgi-bin/modules/BSE/Edit/Product.pm b/site/cgi-bin/modules/BSE/Edit/Product.pm index d90ce205..ecbf9290 100644 --- a/site/cgi-bin/modules/BSE/Edit/Product.pm +++ b/site/cgi-bin/modules/BSE/Edit/Product.pm @@ -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);