[-] BO : fixed bug #PSCFV-2285 - Unable to activate/deactivate a product from list
This commit is contained in:
@@ -655,16 +655,12 @@ abstract class ObjectModelCore
|
|||||||
// Object must have a variable called 'active'
|
// Object must have a variable called 'active'
|
||||||
if (!array_key_exists('active', $this))
|
if (!array_key_exists('active', $this))
|
||||||
throw new PrestaShopException('property "active is missing in object '.get_class($this));
|
throw new PrestaShopException('property "active is missing in object '.get_class($this));
|
||||||
|
|
||||||
// Update active status on object
|
// Update active status on object
|
||||||
$this->active = !(int)$this->active;
|
$this->active = !(int)$this->active;
|
||||||
|
|
||||||
// Change status to active/inactive
|
// Change status to active/inactive
|
||||||
return Db::getInstance()->execute('
|
return $this->update();
|
||||||
UPDATE `'.pSQL(_DB_PREFIX_.$this->def['table']).'`
|
|
||||||
SET `active` = !`active`
|
|
||||||
WHERE `'.pSQL($this->def['primary']).'` = '.(int)$this->id
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user