FIX: We should be able to import value '0'
This commit is contained in:
parent
695cccca1c
commit
0e7fb80a34
@ -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
|
|||||||
// 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';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user