Skip to content
Permalink
Browse files

Don't need to check for empty because Model::validator() returns an i…

…nterator
  • Loading branch information...
thegallagher committed Jul 30, 2013
1 parent 5937685 commit bce0eb37b4660f945030a60183bb64e9a8a895ef
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/Cake/View/Helper/FormHelper.php
@@ -218,11 +218,9 @@ protected function _introspectModel($model, $key, $field = null) {
if ($key === 'validates' && !isset($this->fieldset[$model]['validates'])) {
$validates = array();
if ($object->validator()->count() > 0) {
foreach ($object->validator() as $validateField => $validateProperties) {
if ($this->_isRequiredField($validateProperties)) {
$validates[$validateField] = true;
}
foreach ($object->validator() as $validateField => $validateProperties) {
if ($this->_isRequiredField($validateProperties)) {
$validates[$validateField] = true;
}
}
$this->fieldset[$model]['validates'] = $validates;

0 comments on commit bce0eb3

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.