Skip to content

Commit

Permalink
Conditionally set invalid property.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Scherer committed Jan 3, 2016
1 parent 357a729 commit 5426aeb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Datasource/RulesChecker.php
Expand Up @@ -328,11 +328,10 @@ protected function _addError($rule, $name, $options)
}
$entity->errors($options['errorField'], $message);

$invalid = null;
if (isset($entity->{$options['errorField']})) {
$invalid = $entity->{$options['errorField']};
$invalidValue = $entity->{$options['errorField']};
$entity->invalid($options['errorField'], $invalidValue);
}
$entity->invalid($options['errorField'], $invalid);

return $pass === true;
};
Expand Down

0 comments on commit 5426aeb

Please sign in to comment.