fixed react forms (new bug discovered on new forms with default values not saved)

This commit is contained in:
Jonathan Labreuille
2016-05-18 16:06:31 +02:00
parent 0c8a8c6854
commit 046127eeba
17 changed files with 164 additions and 66 deletions

View File

@ -13,9 +13,12 @@ class Select extends Base {
$html .= static::renderLabel($block);
$html .= '<select class="mailpoet_select" name="'.$field_name.'">';
if(isset($block['params']['label_within'])
&& $block['params']['label_within']) {
if(isset($block['params']['label_within']) && $block['params']['label_within']) {
$html .= '<option value="">'.static::getFieldLabel($block).'</option>';
} else {
if(empty($block['params']['required']) || !$block['params']['required']) {
$html .= '<option value="">-</option>';
}
}
$options = (!empty($block['params']['values'])