Skip to content

Commit

Permalink
Use ModelValidator::count() to count dynamiclly added validation rules
Browse files Browse the repository at this point in the history
  • Loading branch information
thegallagher committed Jul 26, 2013
1 parent 8b21710 commit 5937685
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/FormHelper.php
Expand Up @@ -218,7 +218,7 @@ protected function _introspectModel($model, $key, $field = null) {

if ($key === 'validates' && !isset($this->fieldset[$model]['validates'])) {
$validates = array();
if (!empty($object->validate)) {
if ($object->validator()->count() > 0) {
foreach ($object->validator() as $validateField => $validateProperties) {
if ($this->_isRequiredField($validateProperties)) {
$validates[$validateField] = true;
Expand Down

0 comments on commit 5937685

Please sign in to comment.