// Import categories improvement

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13976 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vChabot
2012-03-08 14:41:10 +00:00
parent b8f637ee5b
commit 0b5653aeba
2 changed files with 6 additions and 8 deletions
+5 -2
View File
@@ -800,9 +800,12 @@ class AdminImportControllerCore extends AdminController
$line = $this->utf8EncodeArray($line);
$info = AdminImportController::getMaskedRow($line);
if (!isset($info['id']) || (int)$info['id'] < 2)
$tab_categ = array(Configuration::get('PS_HOME_CATEGORY'), Configuration::get('PS_ROOT_CATEGORY'));
if (isset($info['id']) && in_array((int)$info['id'], $tab_categ))
{
$this->errors[] = Tools::displayError('The ID category cannot be the same as the ID Root category, nor the ID Home category');
continue;
}
AdminImportController::setDefaultValues($info);
$category = new Category();
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $category);