Skip to content

Commit

Permalink
Copy changes made to $this->data in beforeValidate callbacks back to …
Browse files Browse the repository at this point in the history
…saveAssociated data variable

This allow changes in beforeValidate to be saved
  • Loading branch information
jippi committed May 9, 2012
1 parent 597913a commit 45a86a8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/Cake/Model/Model.php
Expand Up @@ -2178,6 +2178,7 @@ public function saveAssociated($data = null, $options = array()) {

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

0 comments on commit 45a86a8

Please sign in to comment.