# Could not find validation handler 1

**URL:** <https://discourse.cakephp.org/t/could-not-find-validation-handler-1/258>\
**Category:** Need Help\
**Created:** [May 5, 2016, 12:20pm UTC](https://discourse.cakephp.org/t/could-not-find-validation-handler-1/258 "2016-05-05T12:20:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![meness](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@meness](https://discourse.cakephp.org/u/meness)\
**Post date:** [May 5, 2016, 12:20pm UTC](https://discourse.cakephp.org/t/could-not-find-validation-handler-1/258/1 "2016-05-05T12:20:44Z")

</div>

Hi,

Based on following line from CakePHP:

```php
trigger_error(__d('cake_dev', 'Could not find validation handler %s for %s', $this->_rule, $field), E_USER_WARNING);

```

And rules for the field:

```php
'number' => array(
            'required' => true,
            'isUnique' => array('rule' => 'isUnique', 'on' => 'create'),
            'notBlank' => array('rule' => 'notBlank'),
            'maxLength' => array('rule' => array('maxLength', 15)))

```

CakePHP detects `required => true` as a rule! When I remove that line, everything works fine!

**Note:** the field already exists into the data:

```php
$data = array(
	'name' => 'xxx',
	'fields' => 'xxx',
	'startYear' => '999',
	'biography' => 'xxx',
	'headquarter' => 'xxx',
	'number' => '(999) 9999-9999',
	'tags' => 'xxx',
	'updateTime' => '9999999999'
)

```

How can I fix that problem?

---

<div class="post-metadata">

**Author:** ![jeremyharris](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/jeremyharris/32/66_2.png) [@jeremyharris](https://discourse.cakephp.org/u/jeremyharris)\
**Post date:** [May 5, 2016, 3:32pm UTC](https://discourse.cakephp.org/t/could-not-find-validation-handler-1/258/2 "2016-05-05T15:32:27Z")

</div>

Is this Cake 2? If so, the `required` key goes in the rule definition:

```auto
'number' => [
  'isUnique' => [
    'required' => true, // here
    'rule' => 'isUnique',
    'on' => 'create'
  ]
]

```

---

<div class="post-metadata">

**Author:** ![meness](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@meness](https://discourse.cakephp.org/u/meness)\
**Post date:** [May 7, 2016, 1:23pm UTC](https://discourse.cakephp.org/t/could-not-find-validation-handler-1/258/3 "2016-05-07T13:23:00Z")

</div>

Thanks Jeremy. You saved me.
