Merge pull request #644 from nodesagency/hotfix/beforeValidate-copy-data

Hotfix/before validate copy data ( Another fix for Pull request 642 )
This commit is contained in:
José Lorenzo Rodríguez 2012-05-09 15:00:38 -07:00
commit 0f54758e5a

View file

@ -2117,6 +2117,7 @@ class Model extends Object implements CakeEventListener {
} else { } else {
$validates = $this->create($record) && $this->validates($options); $validates = $this->create($record) && $this->validates($options);
} }
$data[$key] = $this->data;
if ($validates === false || (is_array($validates) && in_array(false, $validates, true))) { if ($validates === false || (is_array($validates) && in_array(false, $validates, true))) {
$validationErrors[$key] = $this->validationErrors; $validationErrors[$key] = $this->validationErrors;
$validates = false; $validates = false;
@ -2125,6 +2126,7 @@ class Model extends Object implements CakeEventListener {
} }
$return[$key] = $validates; $return[$key] = $validates;
} }
$this->data = $data;
$this->validationErrors = $validationErrors; $this->validationErrors = $validationErrors;
if (!$options['atomic']) { if (!$options['atomic']) {
return $return; return $return;