From af32a55faddf38143cd19ffa9327aa5f2b8dae85 Mon Sep 17 00:00:00 2001 From: lLefevre Date: Wed, 3 Oct 2012 12:08:00 +0000 Subject: [PATCH] [-] BO : fix #PSCFV-4626 --- controllers/admin/AdminImportController.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index f7654de48..e848166ae 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -855,7 +855,12 @@ class AdminImportControllerCore extends AdminController if (Tools::getValue('forceIDs') && isset($info['id']) && (int)$info['id']) $category = new Category((int)$info['id']); else - $category = new Category(); + { + if (isset($info['id']) && (int)$info['id'] && Category::existsInDatabase((int)$info['id'], 'category')) + $category = new Category((int)$info['id']); + else + $category = new Category(); + } AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $category); @@ -1019,7 +1024,12 @@ class AdminImportControllerCore extends AdminController if (Tools::getValue('forceIDs') && isset($info['id']) && (int)$info['id']) $product = new Product((int)$info['id']); else - $product = new Product(); + { + if (array_key_exists('id', $info) && (int)$info['id'] && Product::existsInDatabase((int)$info['id'], 'product')) + $product = new Product((int)$info['id']); + else + $product = new Product(); + } if (array_key_exists('id', $info) && (int)$info['id'] && Product::existsInDatabase((int)$info['id'], 'product')) {