mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
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:
commit
0f54758e5a
1 changed files with 2 additions and 0 deletions
|
@ -2117,6 +2117,7 @@ class Model extends Object implements CakeEventListener {
|
|||
} 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 @@ class Model extends Object implements CakeEventListener {
|
|||
}
|
||||
$return[$key] = $validates;
|
||||
}
|
||||
$this->data = $data;
|
||||
$this->validationErrors = $validationErrors;
|
||||
if (!$options['atomic']) {
|
||||
return $return;
|
||||
|
|
Loading…
Reference in a new issue