Fix 0 is a valif value for a NOT NULL field

This commit is contained in:
fappels 2018-01-14 15:31:31 +01:00
parent f0d6099e5f
commit 25b455272a

View File

@ -6221,7 +6221,7 @@ abstract class CommonObject
if (! empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key]='';
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
if ($this->fields[$key]['notnull'] == 1 && empty($values[$key]))
if ($this->fields[$key]['notnull'] == 1 && ! isset($values[$key]))
{
$error++;
$this->errors[]=$langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);