Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use ModelValidator::count() to count dynamiclly added validation rules

  • Loading branch information...
commit 5937685817126bceb2fd60782cbab4cae3293974 1 parent 8b21710
@thegallagher thegallagher authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/Cake/View/Helper/FormHelper.php
View
2  lib/Cake/View/Helper/FormHelper.php
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.