Skip to content
Browse files

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

Hotfix/before validate copy data ( Another fix for Pull request 642 )
  • Loading branch information...
2 parents b4a42e4 + e8fce37 commit 0f54758e5a5e2ac369234e506827925bd781d9ea @lorenzo lorenzo committed
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/Cake/Model/Model.php
View
2 lib/Cake/Model/Model.php
@@ -2117,6 +2117,7 @@ public function validateMany($data, $options = array()) {
} else {
$validates = $this->create($record) && $this->validates($options);
}
+ $data[$key] = $this->data;
if ($validates === false || (is_array($validates) && in_array(false, $validates, true))) {
$validationErrors[$key] = $this->validationErrors;
$validates = false;
@@ -2125,6 +2126,7 @@ public function validateMany($data, $options = array()) {
}
$return[$key] = $validates;
}
+ $this->data = $data;
$this->validationErrors = $validationErrors;
if (!$options['atomic']) {
return $return;

0 comments on commit 0f54758

Please sign in to comment.
Something went wrong with that request. Please try again.