Skip to content

Commit

Permalink
Backporting changes form 2.2 to fix some edge cases on deep saving. F…
Browse files Browse the repository at this point in the history
…ixes #2879
  • Loading branch information
lorenzo committed May 20, 2012
1 parent 7dbd6bc commit 16847b0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Cake/Model/Model.php
Expand Up @@ -2343,6 +2343,11 @@ public function validateAssociated(&$data, $options = array()) {
$return[$this->alias] = true;
}
$data = $this->data;
if (!empty($options['deep']) && isset($data[$this->alias])) {
$recordData = $data[$this->alias];
unset($data[$this->alias]);
$data = array_merge($data, $recordData);
}

$associations = $this->getAssociated();
foreach ($data as $association => &$values) {
Expand Down

0 comments on commit 16847b0

Please sign in to comment.