]> git.imager.perl.org - bse.git/commitdiff
use default_value to select the default when adding a product option
authorTony Cook <tony@develop-help.com>
Sat, 18 Apr 2020 09:46:25 +0000 (19:46 +1000)
committerTony Cook <tony@develop-help.com>
Sat, 18 Apr 2020 09:46:25 +0000 (19:46 +1000)
to match the edit form

site/cgi-bin/modules/BSE/Edit/Product.pm
site/templates/admin/edit_prodopts.tmpl

index e85fc05cf6d97cdcbc214a9ac09e59f1099df890..3847bddf1518e6748a31a7169bd385f0ad840525 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.017";
+our $VERSION = "1.018";
 
 =head1 NAME
 
@@ -780,7 +780,7 @@ sub req_add_option {
       ++$order;
     }
   }
-  my $def = $cgi->param("default");
+  my $def = $cgi->param("default_value");
   if ($def && $value_keys{$def}) {
     $option->set_default_value($value_keys{$def}->id);
     $option->save;
index 6de8a667c880661806aba963c31e698e291b64a3..973300caed4700499e0c6a296350d4a97c00ac7d 100644 (file)
@@ -21,7 +21,7 @@
 <:.define addform_value_entry:>
 <div class="valueentry<:= index mod 2 == 0 ? "" : " odd":>">
   <span><input type="text" name="value<:= index :>" value="<:= cgi.param("value" _ index) :>" maxlength="255" class="editor_field" title="Enter some values here" /></span>
-  <span><input type="radio" name="default" value="value<:= index :>"></span>
+  <span><input type="radio" name="default_value" value="value<:= index :>"></span>
   <span><:.call "error_img", field: "value" _ index:></span>
 </div>
 <:.end define:>