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 committed by Jose Lorenzo Rodriguez
parent 7592eb94ac
commit 7a1275a1b1

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;
}