[-] BO: Fix category association in global context #PSCFV-5551
This commit is contained in:
+1
-1
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user