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
@ -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