[-] BO : fix #PSCFV-4626

This commit is contained in:
lLefevre committed 2012-10-03 12:08:00 +00:00
1 parent 70fc8aed29
commit af32a55fad
1 file changed
+10
@@ -854,8 +854,13 @@ class AdminImportControllerCore extends AdminController
if (Tools::getValue('forceIDs') && isset($info['id']) && (int)$info['id']) if (Tools::getValue('forceIDs') && isset($info['id']) && (int)$info['id'])
$category = new Category((int)$info['id']); $category = new Category((int)$info['id']);
else
{
if (isset($info['id']) && (int)$info['id'] && Category::existsInDatabase((int)$info['id'], 'category'))
$category = new Category((int)$info['id']);
else else
$category = new Category(); $category = new Category();
}
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $category); AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $category);
@@ -1018,8 +1023,13 @@ class AdminImportControllerCore extends AdminController
if (Tools::getValue('forceIDs') && isset($info['id']) && (int)$info['id']) if (Tools::getValue('forceIDs') && isset($info['id']) && (int)$info['id'])
$product = new Product((int)$info['id']); $product = new Product((int)$info['id']);
else
{
if (array_key_exists('id', $info) && (int)$info['id'] && Product::existsInDatabase((int)$info['id'], 'product'))
$product = new Product((int)$info['id']);
else else
$product = new Product(); $product = new Product();
}
if (array_key_exists('id', $info) && (int)$info['id'] && Product::existsInDatabase((int)$info['id'], 'product')) if (array_key_exists('id', $info) && (int)$info['id'] && Product::existsInDatabase((int)$info['id'], 'product'))
{ {