Skip to content
Snippets Groups Projects
Commit 0e7fb80a authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

FIX: We should be able to import value '0'

parent 695cccca
No related branches found
No related tags found
No related merge requests found
...@@ -401,7 +401,7 @@ class ImportCsv extends ModeleImports ...@@ -401,7 +401,7 @@ class ImportCsv extends ModeleImports
// Make some tests on $newval // Make some tests on $newval
// Is it a required field ? // Is it a required field ?
if (preg_match('/\*/',$objimport->array_import_fields[0][$val]) && ($newval=='')) if (preg_match('/\*/',$objimport->array_import_fields[0][$val]) && ((string) $newval==''))
{ {
$this->errors[$error]['lib']=$langs->trans('ErrorMissingMandatoryValue',$key); $this->errors[$error]['lib']=$langs->trans('ErrorMissingMandatoryValue',$key);
$this->errors[$error]['type']='NOTNULL'; $this->errors[$error]['type']='NOTNULL';
......
...@@ -419,7 +419,7 @@ class Importxlsx extends ModeleImports ...@@ -419,7 +419,7 @@ class Importxlsx extends ModeleImports
// Make some tests on $newval // Make some tests on $newval
// Is it a required field ? // Is it a required field ?
if (preg_match('/\*/',$objimport->array_import_fields[0][$val]) && ($newval=='')) if (preg_match('/\*/',$objimport->array_import_fields[0][$val]) && ((string) $newval == ''))
{ {
$this->errors[$error]['lib']=$langs->trans('ErrorMissingMandatoryValue',$key); $this->errors[$error]['lib']=$langs->trans('ErrorMissingMandatoryValue',$key);
$this->errors[$error]['type']='NOTNULL'; $this->errors[$error]['type']='NOTNULL';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment