From 1259ea63c6048072a30469002d20e5771f4b089d Mon Sep 17 00:00:00 2001 From: vSchoener Date: Tue, 3 Jan 2012 14:46:53 +0000 Subject: [PATCH] // Reported bug #PSCFI-4407 about bad column id for categories and checked distant file --- controllers/admin/AdminImportController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index a5429dd2d..5a8e45878 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -774,7 +774,9 @@ class AdminImportControllerCore extends AdminController break; } $url = str_replace(' ', '%20', trim($url)); - if (file_exists($url) && copy($url, $tmpfile)) + // 'file_exists' doesn't work on distant file, and getimagesize make the import slower. + // Just hide the warning, the traitment will be the same. + if (@copy($url, $tmpfile)) { imageResize($tmpfile, $path.'.jpg'); $images_types = ImageType::getImagesTypes($entity); @@ -809,6 +811,9 @@ class AdminImportControllerCore extends AdminController $line = $this->utf8EncodeArray($line); $info = self::getMaskedRow($line); + if (!isset($info['id']) || (int)$info['id'] < 2) + continue; + self::setDefaultValues($info); $category = new Category(); self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $category);