[-] BO: Fix category association in global context #PSCFV-5551

This commit is contained in:
Rémi Gaillard
2012-12-03 11:25:59 +01:00
parent 088cb759f0
commit 4a106e51bb
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -798,7 +798,7 @@ class ProductCore extends ObjectModel
SELECT c.`id_category`
FROM `'._DB_PREFIX_.'category_product` cp
LEFT JOIN `'._DB_PREFIX_.'category` c ON (c.`id_category` = cp.`id_category`)
'.Shop::addSqlAssociation('category', 'c', true).'
'.Shop::addSqlAssociation('category', 'c', true, null, true).'
WHERE cp.`id_category` NOT IN ('.implode(',', array_map('intval', $categories)).')
AND cp.id_product = '.$this->id
);
@@ -1704,7 +1704,7 @@ class AdminProductsControllerCore extends AdminController
$this->updateDownloadProduct($object, 1);
$this->updateTags(Language::getLanguages(false), $object);
if ($this->isProductFieldUpdated('category_box') && !$object->updateCategories(Tools::getValue('categoryBox'), true))
if ($this->isProductFieldUpdated('category_box') && !$object->updateCategories(Tools::getValue('categoryBox')))
$this->errors[] = Tools::displayError('An error occurred while linking object.').' <b>'.$this->table.'</b> '.Tools::displayError('To categories');
}