Merge pull request #14656 from OPEN-DSI/v10-fix-extrafields-select-required
FIX no empty value in required extrafield
This commit is contained in:
commit
377c44eeab
@ -1147,7 +1147,7 @@ class ExtraFields
|
|||||||
}
|
}
|
||||||
|
|
||||||
$out.='<select class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam?$moreparam:'').'>';
|
$out.='<select class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam?$moreparam:'').'>';
|
||||||
$out.='<option value="0"> </option>';
|
$out .= '<option value="0"> </option>';
|
||||||
foreach ($param['options'] as $key => $val)
|
foreach ($param['options'] as $key => $val)
|
||||||
{
|
{
|
||||||
if ((string) $key == '') continue;
|
if ((string) $key == '') continue;
|
||||||
@ -2008,8 +2008,8 @@ class ExtraFields
|
|||||||
if ($this->attributes[$object->table_element]['required'][$key]) // Value is required
|
if ($this->attributes[$object->table_element]['required'][$key]) // Value is required
|
||||||
{
|
{
|
||||||
// Check if empty without using GETPOST, value can be alpha, int, array, etc...
|
// Check if empty without using GETPOST, value can be alpha, int, array, etc...
|
||||||
if ((! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] != 'select' && $_POST["options_".$key] != '0')
|
if ((! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && !in_array($this->attributes[$object->table_element]['type'][$key], array('select', 'sellist')) && $_POST["options_".$key] != '0')
|
||||||
|| (! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'select')
|
|| (! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && in_array($this->attributes[$object->table_element]['type'][$key], array('select', 'sellist')))
|
||||||
|| (is_array($_POST["options_".$key]) && empty($_POST["options_".$key])))
|
|| (is_array($_POST["options_".$key]) && empty($_POST["options_".$key])))
|
||||||
{
|
{
|
||||||
//print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key];
|
//print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user