From d97109f53b41642893c5a42b2275e47f2274ddb6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2011 21:24:47 +0000 Subject: [PATCH] Fix: Removed warning when foreign key table is empty --- htdocs/includes/modules/import/import_csv.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/includes/modules/import/import_csv.modules.php b/htdocs/includes/modules/import/import_csv.modules.php index abef5753714..4273f92e477 100644 --- a/htdocs/includes/modules/import/import_csv.modules.php +++ b/htdocs/includes/modules/import/import_csv.modules.php @@ -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'; @@ -463,7 +463,7 @@ class ImportCsv extends ModeleImports /** * Clean a string from separator */ -function cleansep($value) +function cleansep($value) { return str_replace(',','/',$value); };