From ef4b3576fcd128a57d07ddf909acf9cf957041ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 11 Dec 2012 16:05:29 +0100 Subject: [PATCH] [-] BO: Improve memory usage in admin product in global context with a lot of shops and attributes --- classes/Attribute.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/classes/Attribute.php b/classes/Attribute.php index 71e324c15..b6ac51e39 100644 --- a/classes/Attribute.php +++ b/classes/Attribute.php @@ -47,7 +47,6 @@ class AttributeCore extends ObjectModel 'color' => array('type' => self::TYPE_STRING, 'validate' => 'isColor'), 'position' => array('type' => self::TYPE_INT, 'validate' => 'isInt'), - // Lang fields 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64), ) ); @@ -130,7 +129,7 @@ class AttributeCore extends ObjectModel return array(); return Db::getInstance()->executeS(' - SELECT ag.*, agl.*, a.`id_attribute`, al.`name`, agl.`name` AS `attribute_group` + SELECT DISTINCT ag.*, agl.*, a.`id_attribute`, al.`name`, agl.`name` AS `attribute_group` FROM `'._DB_PREFIX_.'attribute_group` ag LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$id_lang.')