mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
updating form handling of required validation, fixes #3869
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6391 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
c91b3721bc
commit
411bf98d40
1 changed files with 3 additions and 1 deletions
|
@ -567,7 +567,9 @@ class FormHelper extends AppHelper {
|
|||
$divOptions = array_merge($divOptions, $div);
|
||||
}
|
||||
if (in_array($this->field(), $this->fieldset['validates'])) {
|
||||
$divOptions = $this->addClass($divOptions, 'required');
|
||||
if (!isset($this->fieldset['validates'][$this->field()]['required']) || isset($this->fieldset['validates'][$this->field()]['required']) && $this->fieldset['validates'][$this->field()]['required'] !== false) {
|
||||
$divOptions = $this->addClass($divOptions, 'required');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue