2
0
forked from Wavyzz/dolibarr

Fix: Removed warning when foreign key table is empty

This commit is contained in:
Laurent Destailleur
2011-06-17 21:24:47 +00:00
parent 9a6cafdf18
commit d97109f53b

View File

@@ -374,8 +374,8 @@ class ImportCsv extends ModeleImports
}
}
// Now we check in cache
if (! in_array($newval,$this->cachefieldtable[$field.'@'.$table]))
// Now we check cache is not empty (should not) and key is into cache
if (! is_array($this->cachefieldtable[$field.'@'.$table]) || ! in_array($newval,$this->cachefieldtable[$field.'@'.$table]))
{
$this->errors[$error]['lib']=$langs->trans('ErrorFieldValueNotIn',$key,$newval,$field,$table);
$this->errors[$error]['type']='FOREIGNKEY';