From 8ff9b2bd4cfdfcabe5dfb60cf467aa51082b276d Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Mon, 14 May 2012 08:10:19 +0000 Subject: [PATCH] [-] BO : fixed bug #PSCFV-2285 - Unable to activate/deactivate a product from list --- classes/ObjectModel.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/classes/ObjectModel.php b/classes/ObjectModel.php index 034a927a5..a4090c805 100644 --- a/classes/ObjectModel.php +++ b/classes/ObjectModel.php @@ -655,16 +655,12 @@ abstract class ObjectModelCore // Object must have a variable called 'active' if (!array_key_exists('active', $this)) throw new PrestaShopException('property "active is missing in object '.get_class($this)); - + // Update active status on object $this->active = !(int)$this->active; // Change status to active/inactive - return Db::getInstance()->execute(' - UPDATE `'.pSQL(_DB_PREFIX_.$this->def['table']).'` - SET `active` = !`active` - WHERE `'.pSQL($this->def['primary']).'` = '.(int)$this->id - ); + return $this->update(); } /**