From: Matthias Schmidt Date: Mon, 17 Jun 2013 08:43:40 +0000 (+0200) Subject: Fixes validation order in LabelAddForm::validate() X-Git-Tag: 2.0.0_Beta_4~25 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bfde33f93e131da5e1c47d4e2c3e0c42fab1a3a2;p=GitHub%2FWoltLab%2FWCF.git Fixes validation order in LabelAddForm::validate() --- diff --git a/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php index 01d173e379..9b45087b2f 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php @@ -111,6 +111,15 @@ class LabelAddForm extends AbstractForm { public function validate() { parent::validate(); + // validate group + if (!$this->groupID) { + throw new UserInputException('groupID'); + } + $groups = $this->labelGroupList->getObjects(); + if (!isset($groups[$this->groupID])) { + throw new UserInputException('groupID', 'notValid'); + } + // validate label if (!I18nHandler::getInstance()->validateValue('label')) { if (I18nHandler::getInstance()->isPlainValue('label')) { @@ -121,15 +130,7 @@ class LabelAddForm extends AbstractForm { } } - // validate group - if (!$this->groupID) { - throw new UserInputException('groupID'); - } - $groups = $this->labelGroupList->getObjects(); - if (!isset($groups[$this->groupID])) { - throw new UserInputException('groupID', 'notValid'); - } - + // validate class name if (empty($this->cssClassName)) { throw new UserInputException('cssClassName', 'empty'); }