Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Backporting changes form 2.2 to fix some edge cases on deep saving. F…

…ixes #2879
  • Loading branch information...
commit 16847b0d970fbca8c716728a55c90ba9f0962bc6 1 parent 7dbd6bc
José Lorenzo Rodríguez lorenzo authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/Cake/Model/Model.php
5 lib/Cake/Model/Model.php
View
@@ -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) {
Please sign in to comment.
Something went wrong with that request. Please try again.