summaryrefslogtreecommitdiff
path: root/app/Validator/ProjectValidator.php
diff options
context:
space:
mode:
authorTeamjungla{CODE} <junglacode@gmail.com>2016-08-20 13:47:12 -0500
committerTeamjungla{CODE} <junglacode@gmail.com>2016-08-20 13:47:12 -0500
commitfe8e9cdcfe3afc1475c7e7f4392d2b2cc601a12b (patch)
tree001403874e9e3716de7c6d51a9f536e9b3c3be5e /app/Validator/ProjectValidator.php
parentb1e795fc5b45369f7b9b565b1e106d2673361977 (diff)
parent98efcf21e355ed6ac3827058b99df86ca67c75bb (diff)
Merge branch 'stable' of https://github.com/kanboard/kanboard
Diffstat (limited to 'app/Validator/ProjectValidator.php')
-rw-r--r--app/Validator/ProjectValidator.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Validator/ProjectValidator.php b/app/Validator/ProjectValidator.php
index 9ef59111..8c6117a4 100644
--- a/app/Validator/ProjectValidator.php
+++ b/app/Validator/ProjectValidator.php
@@ -28,7 +28,7 @@ class ProjectValidator extends BaseValidator
new Validators\Integer('priority_start', t('This value must be an integer')),
new Validators\Integer('priority_end', t('This value must be an integer')),
new Validators\Integer('is_active', t('This value must be an integer')),
- new Validators\Required('name', t('The project name is required')),
+ new Validators\NotEmpty('name', t('This field cannot be empty')),
new Validators\MaxLength('name', t('The maximum length is %d characters', 50), 50),
new Validators\MaxLength('identifier', t('The maximum length is %d characters', 50), 50),
new Validators\MaxLength('start_date', t('The maximum length is %d characters', 10), 10),
@@ -47,11 +47,15 @@ class ProjectValidator extends BaseValidator
*/
public function validateCreation(array $values)
{
+ $rules = array(
+ new Validators\Required('name', t('The project name is required')),
+ );
+
if (! empty($values['identifier'])) {
$values['identifier'] = strtoupper($values['identifier']);
}
- $v = new Validator($values, $this->commonValidationRules());
+ $v = new Validator($values, array_merge($this->commonValidationRules(), $rules));
return array(
$v->execute(),