mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Don't need to check for empty because Model::validator() returns an interator
This commit is contained in:
parent
5937685817
commit
bce0eb37b4
1 changed files with 3 additions and 5 deletions
|
@ -218,13 +218,11 @@ class FormHelper extends AppHelper {
|
||||||
|
|
||||||
if ($key === 'validates' && !isset($this->fieldset[$model]['validates'])) {
|
if ($key === 'validates' && !isset($this->fieldset[$model]['validates'])) {
|
||||||
$validates = array();
|
$validates = array();
|
||||||
if ($object->validator()->count() > 0) {
|
|
||||||
foreach ($object->validator() as $validateField => $validateProperties) {
|
foreach ($object->validator() as $validateField => $validateProperties) {
|
||||||
if ($this->_isRequiredField($validateProperties)) {
|
if ($this->_isRequiredField($validateProperties)) {
|
||||||
$validates[$validateField] = true;
|
$validates[$validateField] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$this->fieldset[$model]['validates'] = $validates;
|
$this->fieldset[$model]['validates'] = $validates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue