From 37e6846aab795dbbacb82b6d5d6e044b3e871aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 14 Mar 2013 05:55:11 -0700 Subject: [PATCH] Merge pull request #317 from Shagshag/patch-2 [-] SQL error in Combination::setAttributes --- classes/Combination.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/classes/Combination.php b/classes/Combination.php index 78f0a0a66..27148b7b3 100644 --- a/classes/Combination.php +++ b/classes/Combination.php @@ -134,7 +134,8 @@ class CombinationCore extends ObjectModel public function setAttributes($ids_attribute) { - if ($this->deleteAssociations()) + $result = $this->deleteAssociations(); + if ($result && !empty($ids_attribute)) { $sql_values = array(); foreach ($ids_attribute as $value) @@ -144,10 +145,8 @@ class CombinationCore extends ObjectModel INSERT INTO `'._DB_PREFIX_.'product_attribute_combination` (`id_attribute`, `id_product_attribute`) VALUES '.implode(',', $sql_values) ); - - return $result; } - return false; + return $result; } public function setWsProductOptionValues($values)