mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56: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,11 +218,9 @@ class FormHelper extends AppHelper {
|
|||
|
||||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue