Skip to content
This repository
Browse code

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 authored May 19, 2012

Showing 1 changed file with 5 additions and 0 deletions. Show diff stats Hide diff stats

  1. 5  lib/Cake/Model/Model.php
5  lib/Cake/Model/Model.php
@@ -2343,6 +2343,11 @@ public function validateAssociated(&$data, $options = array()) {
2343 2343
 			$return[$this->alias] = true;
2344 2344
 		}
2345 2345
 		$data = $this->data;
  2346
+		if (!empty($options['deep']) && isset($data[$this->alias])) {
  2347
+			$recordData = $data[$this->alias];
  2348
+			unset($data[$this->alias]);
  2349
+			$data = array_merge($data, $recordData);
  2350
+		}
2346 2351
 
2347 2352
 		$associations = $this->getAssociated();
2348 2353
 		foreach ($data as $association => &$values) {

0 notes on commit 16847b0

Please sign in to comment.
Something went wrong with that request. Please try again.