From 6cdb8badf0853b78a164b60441db136419375084 Mon Sep 17 00:00:00 2001 From: rMalie Date: Fri, 9 Sep 2011 09:42:55 +0000 Subject: [PATCH] // Fix discount creation (bad redirection, missing context value) --- admin-dev/tabs/AdminDiscounts.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/admin-dev/tabs/AdminDiscounts.php b/admin-dev/tabs/AdminDiscounts.php index 2cc329f71..64fc5ed85 100644 --- a/admin-dev/tabs/AdminDiscounts.php +++ b/admin-dev/tabs/AdminDiscounts.php @@ -123,8 +123,6 @@ class AdminDiscounts extends AdminTab $object->update(); $objectNew = new $this->className(); $this->copyFromPost($objectNew, $this->table); - $shop = new Shop((int)$objectNew->id_shop); - $objectNew->id_group_shop = (int)$shop->id_group_shop; $result = $objectNew->add(); if (Validate::isLoadedObject($objectNew)) $this->afterDelete($objectNew, $object->id); @@ -134,8 +132,6 @@ class AdminDiscounts extends AdminTab if (($categories = Tools::getValue('categoryBox')) === false OR (!empty($categories) AND !is_array($categories))) $this->_errors[] = Tools::displayError('Please set a category for this voucher.'); $this->copyFromPost($object, $this->table); - $shop = new Shop((int)$objectNew->id_shop); - $objectNew->id_group_shop = (int)$shop->id_group_shop; $result = $object->update(true, false, $categories); } if (!$result) @@ -163,8 +159,6 @@ class AdminDiscounts extends AdminTab { $object = new $this->className(); $this->copyFromPost($object, $this->table); - $shop = new Shop((int)$objectNew->id_shop); - $objectNew->id_group_shop = (int)$shop->id_group_shop; $categories = Tools::getValue('categoryBox', null); if (!$object->add(true, false, $categories)) $this->_errors[] = Tools::displayError('An error occurred while creating object.').' '.$this->table.''; @@ -201,7 +195,7 @@ class AdminDiscounts extends AdminTab } } - Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&token='.$token); + Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&token='.$token); } } else @@ -359,15 +353,6 @@ class AdminDiscounts extends AdminTab

- -
- -
-