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:
phpnut 2007-04-06 19:05:06 +00:00
parent da5e9c05a5
commit 980e713df7

View file

@ -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 . '.');