Copy changes made to $this->data in beforeValidate callbacks back to saveAssociated data variable

This allow changes in beforeValidate to be saved
This commit is contained in:
Christian Winther 2012-05-09 22:57:21 +02:00
parent 597913aa5b
commit 45a86a8b20

View file

@ -2178,6 +2178,7 @@ class Model extends Object implements CakeEventListener {
if ($options['validate'] === 'first') {
$validates = $this->validateAssociated($data, $options);
$data = $this->data;
if ((!$validates && $options['atomic']) || (!$options['atomic'] && in_array(false, $validates, true))) {
return $validates;
}