From 20e2f0793978dab6974f58200b81a422d846f877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 20 Aug 2013 17:56:26 +0200 Subject: [PATCH] [-] BO: Delete from attribute_shop when an attribute group is deleted #PSCFV-9902 --- classes/AttributeGroup.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/AttributeGroup.php b/classes/AttributeGroup.php index 15f72122a..17f12cadf 100644 --- a/classes/AttributeGroup.php +++ b/classes/AttributeGroup.php @@ -144,9 +144,11 @@ class AttributeGroupCore extends ObjectModel /* Also delete related attributes */ if (Db::getInstance()->execute(' DELETE FROM `'._DB_PREFIX_.'attribute_lang` - WHERE `id_attribute` - IN (SELECT id_attribute FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id.')') === false || - Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id) === false) + WHERE `id_attribute` IN ('.implode(',', $to_remove).')') === false || + Db::getInstance()->execute(' + DELETE FROM `'._DB_PREFIX_.'attribute_shop` + WHERE `id_attribute` IN ('.implode(',', $to_remove).')') === false || + Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id) === false) return false; $this->cleanPositions(); }