// fixxed bug save Product

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11143 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2011-12-12 16:01:26 +00:00
parent 6f3972d946
commit b974418c15
2 changed files with 2 additions and 3 deletions
+2 -2
View File
@@ -725,7 +725,7 @@ class ProductCore extends ObjectModel
foreach ($categories as $new_id_categ)
if (!in_array($new_id_categ, $current_categories))
$new_categ_pos[] = '('.$new_id_categ.', '.$this->id.', '.$new_categ_pos[$new_id_categ].')';
$product_cats[] = '('.$new_id_categ.', '.$this->id.', '.$new_categ_pos[$new_id_categ].')';
if (count($product_cats))
return Db::getInstance()->execute('
INSERT INTO `'._DB_PREFIX_.'category_product` (`id_category`, `id_product`, `position`)
@@ -755,7 +755,7 @@ class ProductCore extends ObjectModel
$this->deleteCategory($categ_to_delete['id_category']);
// if none are found, it's an error
if (!is_array($result))
return (false);
return false;
if (!$this->addToCategories($categories))
return false;