"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:
phpnut 2007-11-28 16:44:59 +00:00
parent a09167a8a6
commit 84b935506c

View file

@ -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;