[-] BO: Fix empty group list on changing opt or newsletter on customers listing

This commit is contained in:
Rémi Gaillard
2013-10-31 11:22:40 +01:00
parent d17515a728
commit 9611ea1f70
+4 -2
View File
@@ -589,9 +589,11 @@ class CustomerCore extends ObjectModel
*/
public function updateGroup($list)
{
$this->cleanGroups();
if ($list && !empty($list))
{
$this->cleanGroups();
$this->addGroups($list);
}
else
$this->addGroups(array($this->id_default_group));
}
@@ -606,7 +608,7 @@ class CustomerCore extends ObjectModel
foreach ($groups as $group)
{
$row = array('id_customer' => (int)$this->id, 'id_group' => (int)$group);
Db::getInstance()->insert('customer_group', $row);
Db::getInstance()->insert('customer_group', $row, false, true, Db::INSERT_IGNORE);
}
}