mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 19:38:26 +00:00
Adding fix for Ticket #2360
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4808 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
da5e9c05a5
commit
980e713df7
1 changed files with 12 additions and 0 deletions
|
@ -104,6 +104,18 @@ class FormHelper extends AppHelper {
|
|||
if(!empty($object->validationErrors)) {
|
||||
$this->validationErrors[$model] = $object->validationErrors;
|
||||
}
|
||||
|
||||
foreach($object->__associations as $type) {
|
||||
foreach($object->{$type} as $assoc => $value) {
|
||||
if (is_array($value) && isset($value['className']) && low($value['className']) !== low($object->name) && ClassRegistry::isKeySet($value['className'])) {
|
||||
$innerObject =& ClassRegistry::getObject($value['className']);
|
||||
|
||||
if(!empty($innerObject->validationErrors)) {
|
||||
$this->validationErrors[$innerObject->name] = $innerObject->validationErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->setFormTag($model . '.');
|
||||
|
|
Loading…
Reference in a new issue