diff --git a/classes/shop/GroupShop.php b/classes/shop/GroupShop.php index 15d172253..324fe0c16 100644 --- a/classes/shop/GroupShop.php +++ b/classes/shop/GroupShop.php @@ -44,7 +44,7 @@ class GroupShopCore extends ObjectModel 'table' => 'group_shop', 'primary' => 'id_group_shop', 'fields' => array( - 'name' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 64), + 'name' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 64), 'share_customer' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'share_order' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'share_stock' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), diff --git a/controllers/admin/AdminGroupShopController.php b/controllers/admin/AdminGroupShopController.php index fec374d01..6a551150a 100644 --- a/controllers/admin/AdminGroupShopController.php +++ b/controllers/admin/AdminGroupShopController.php @@ -256,9 +256,6 @@ class AdminGroupShopControllerCore extends AdminController public function postProcess() { - if (Tools::isSubmit('submitAdd'.$this->table)) - if (!isset($_POST['name']) || empty($_POST['name'])) - $this->_errors[] = Tools::displayError('A group name is required.'); if (Tools::isSubmit('delete'.$this->table) || Tools::isSubmit('status') || Tools::isSubmit('status'.$this->table)) { $object = $this->loadObject();