mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
"Fixing return of data from Model::save() when a behavior alters the data removing saved content"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6095 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
a09167a8a6
commit
84b935506c
1 changed files with 4 additions and 1 deletions
|
@ -1198,6 +1198,9 @@ class Model extends Overloadable {
|
|||
}
|
||||
|
||||
if ($success && $count > 0) {
|
||||
if (!empty($this->data)) {
|
||||
$success = $this->data;
|
||||
}
|
||||
if (!empty($this->behaviors)) {
|
||||
$behaviors = array_keys($this->behaviors);
|
||||
$ct = count($behaviors);
|
||||
|
@ -1207,7 +1210,7 @@ class Model extends Overloadable {
|
|||
}
|
||||
$this->afterSave($created);
|
||||
if (!empty($this->data)) {
|
||||
$success = $this->data;
|
||||
$success = Set::pushDiff($success, $this->data);
|
||||
}
|
||||
$this->data = false;
|
||||
$this->__exists = null;
|
||||
|
|
Loading…
Reference in a new issue