From 38ee53c222a592af1161b6be2da260f6f5260519 Mon Sep 17 00:00:00 2001 From: rMalie Date: Thu, 29 Dec 2011 13:07:48 +0000 Subject: [PATCH] [-] BO : Fixed #PSFV-281 : new created tab are now set active by default git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11885 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/Tab.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/classes/Tab.php b/classes/Tab.php index 41be6a2a9..567245602 100644 --- a/classes/Tab.php +++ b/classes/Tab.php @@ -42,7 +42,7 @@ class TabCore extends ObjectModel public $position; /** @var integer active */ - public $active; + public $active = true; /** * @see ObjectModel::$definition @@ -56,7 +56,7 @@ class TabCore extends ObjectModel 'position' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'module' => array('type' => self::TYPE_STRING, 'validate' => 'isTabName', 'size' => 64), 'class_name' => array('type' => self::TYPE_STRING, 'required' => true, 'size' => 64), - 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), + 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), // Lang fields 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 32), @@ -77,10 +77,6 @@ class TabCore extends ObjectModel public function add($autodate = true, $null_values = false) { $this->position = self::getNewLastPosition($this->id_parent); - // if you don't precise active or not, automatically set it - if (is_null($this->active)) - $this->active = 1; - if (parent::add($autodate, $null_values)) { // refresh cache when adding new tab