mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-18 23:49:55 +00:00
Use ModelValidator::count() to count dynamiclly added validation rules
This commit is contained in:
parent
8b21710c95
commit
5937685817
1 changed files with 1 additions and 1 deletions
|
@ -218,7 +218,7 @@ 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 (!empty($object->validate)) {
|
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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue