From 353eab91d5b78214bc1bc40682e37c2fb9e5fe65 Mon Sep 17 00:00:00 2001 From: phpnut Date: Wed, 24 Oct 2007 17:44:27 +0000 Subject: [PATCH] Adding fix for lost data in Model::afterSave(); Closes #2465, Model::save(); now returns the values of $this->data after a successful save; git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5894 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index d6dcbfdf8..fabd18d3f 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -846,8 +846,8 @@ class Model extends Overloadable { if ($x === $this->primaryKey) { $this->id = $y; } - $this->data[$n][$x] = $y; } + $this->data[$n][$x] = $y; } } } @@ -1186,6 +1186,7 @@ class Model extends Overloadable { } } $this->afterSave($created); + $success = $this->data; $this->data = false; $this->__exists = null; $this->_clearCache();