Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Reverting change done to validation that was duplicating the validate…

…s() process for the main model, returning the correct value in validateAssociated() instead
  • Loading branch information...
commit 8c60e01235623af57a1dc512eb9ee5c91130f3dd 1 parent cfd2d9e
@lorenzo lorenzo authored
Showing with 2 additions and 7 deletions.
  1. +2 −7 lib/Cake/Model/Model.php
View
9 lib/Cake/Model/Model.php
@@ -1634,15 +1634,10 @@ public function saveAll($data = null, $options = array()) {
return $this->saveMany($data, $options);
}
if ($options['validate'] === 'only') {
- $this->create($data);
- $validates = $this->validates($options);
$validatesAssoc = $this->validateAssociated($data, $options);
- if (!$validates) {
+ if (isset($this->validationErrors[$this->alias]) && $this->validationErrors[$this->alias] === false) {
return false;
}
- if (is_bool($validatesAssoc)) {
- return $validates && $validatesAssoc;
- }
return $validatesAssoc;
}
return $this->saveAssociated($data, $options);
@@ -1912,7 +1907,7 @@ public function validateAssociated($data, $options = array()) {
if (!$options['atomic']) {
return $return;
}
- if (!empty($this->validationErrors)) {
+ if ($return[$this->alias] === false || !empty($this->validationErrors)) {
return false;
}
return true;
Please sign in to comment.
Something went wrong with that request. Please try again.