Skip to content
Permalink
Browse files

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

  • Loading branch information...
thegallagher committed Jul 26, 2013
1 parent 8b21710 commit 5937685817126bceb2fd60782cbab4cae3293974
Showing with 1 addition and 1 deletion.
  1. +1 −1 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;

0 comments on commit 5937685

Please sign in to comment.
You can’t perform that action at this time.