2
0
forked from Wavyzz/dolibarr

FIX Required extrafield value numeric should accept '0'

This commit is contained in:
Laurent Destailleur
2018-10-08 14:26:18 +02:00
parent 7be9b6d94e
commit 0c7b7ed7f4

View File

@@ -1847,11 +1847,16 @@ class ExtraFields
if (empty($enabled)) continue;
if (empty($perms)) continue;
if ($this->attributes[$object->table_element]['required'][$key] && empty($_POST["options_".$key])) // Check if empty without GETPOST, value can be alpha, int, array, etc...
if ($this->attributes[$object->table_element]['required'][$key]) // Value is required
{
//print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key];
$nofillrequired++;
$error_field_required[] = $langs->transnoentitiesnoconv($value);
// Check if empty without using GETPOST, value can be alpha, int, array, etc...
if ((! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $_POST["options_".$key] != '0')
|| (is_array($_POST["options_".$key]) && empty($_POST["options_".$key])))
{
//print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key];
$nofillrequired++;
$error_field_required[] = $langs->transnoentitiesnoconv($value);
}
}
if (in_array($key_type,array('date')))