[-] BO : fix #PSCFV-4901

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17832 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2012-10-11 09:02:17 +00:00
parent 16724949e4
commit 74bd18ae5f
+10 -5
View File
@@ -1776,9 +1776,18 @@ class AdminImportControllerCore extends AdminController
AdminImportController::setDefaultValues($info);
if (Tools::getValue('forceIDs') && isset($info['id']) && (int)$info['id'])
$customer = new Customer((int)$info['id']);
else
{
if (array_key_exists('id', $info) && (int)$info['id'] && Customer::customerIdExistsStatic((int)$info['id']))
$customer = new Customer((int)$info['id']);
else
$customer = new Customer();
}
if (array_key_exists('id', $info) && (int)$info['id'] && Customer::customerIdExistsStatic((int)$info['id']))
{
$customer = new Customer((int)$info['id']);
$current_id_customer = $customer->id;
$current_id_shop = $customer->id_shop;
$current_id_shop_group = $customer->id_shop_group;
@@ -1789,8 +1798,6 @@ class AdminImportControllerCore extends AdminController
if ($group == $customer->id_default_group)
unset($customer_groups[$key]);
}
else
$customer = new Customer();
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $customer);
@@ -1847,7 +1854,6 @@ class AdminImportControllerCore extends AdminController
else
{
unset($customer->id);
$res &= $customer->add();
if (isset($customer_groups))
$customer->addGroups($customer_groups);
@@ -1872,7 +1878,6 @@ class AdminImportControllerCore extends AdminController
}
else
{
unset($customer->id);
$res &= $customer->add();
if (isset($customer_groups))
$customer->addGroups($customer_groups);