From 9611ea1f70ccfa577168d85bf0b854840423ee29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 31 Oct 2013 11:22:40 +0100 Subject: [PATCH] [-] BO: Fix empty group list on changing opt or newsletter on customers listing --- classes/Customer.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/Customer.php b/classes/Customer.php index f8a01c5ce..431d217e6 100644 --- a/classes/Customer.php +++ b/classes/Customer.php @@ -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); } }