diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index d334845f2..c3736749c 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -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 . '.');