Skip to content

Commit

Permalink
Merge branch 'validate-nested-pass-newrecord' of https://github.com/a…
Browse files Browse the repository at this point in the history
…nkr/cakephp into ankr-validate-nested-pass-newrecord
  • Loading branch information
lorenzo committed Nov 4, 2015
2 parents 59d5e33 + 5b7d8bc commit db63617
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Validation/Validator.php
Expand Up @@ -347,7 +347,7 @@ public function addNested($field, Validator $validator)
foreach ($this->providers() as $provider) {
$validator->provider($provider, $this->provider($provider));
}
$errors = $validator->errors($value);
$errors = $validator->errors($value, $context['newRecord']);
return empty($errors) ? true : $errors;
}]);
return $this;
Expand Down Expand Up @@ -385,7 +385,7 @@ public function addNestedMany($field, Validator $validator)
if (!is_array($row)) {
return false;
}
$check = $validator->errors($row);
$check = $validator->errors($row, $context['newRecord']);
if (!empty($check)) {
$errors[$i] = $check;
}
Expand Down

0 comments on commit db63617

Please sign in to comment.