From 5937685817126bceb2fd60782cbab4cae3293974 Mon Sep 17 00:00:00 2001 From: David Gallagher Date: Fri, 26 Jul 2013 22:44:59 +1000 Subject: [PATCH] Use ModelValidator::count() to count dynamiclly added validation rules --- lib/Cake/View/Helper/FormHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index 4b1ec6c1d..5f5585d06 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -218,7 +218,7 @@ class FormHelper extends AppHelper { 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;