mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-07 12:02:41 +00:00
Removing continue statement that did nothing.
Adding a rollback for when validation fails and atomic has been set. Tests added. Fixes #797
This commit is contained in:
parent
bca3c4ab38
commit
ad8b70cec2
2 changed files with 32 additions and 1 deletions
|
@ -1622,7 +1622,6 @@ class Model extends Overloadable {
|
|||
case ($options['validate'] === 'first'):
|
||||
$options['validate'] = true;
|
||||
$return = array();
|
||||
continue;
|
||||
break;
|
||||
default:
|
||||
if ($options['atomic']) {
|
||||
|
@ -1636,6 +1635,10 @@ class Model extends Overloadable {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if ($options['atomic'] && !$validates) {
|
||||
$db->rollback($this);
|
||||
return false;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
$associations = $this->getAssociated();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue