mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Backporting changes form 2.2 to fix some edge cases on deep saving. Fixes #2879
This commit is contained in:
parent
7dbd6bc3a2
commit
16847b0d97
1 changed files with 5 additions and 0 deletions
|
@ -2343,6 +2343,11 @@ class Model extends Object implements CakeEventListener {
|
|||
$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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue