Skip to content

Commit

Permalink
saveAsRoot transaction fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AidasK committed May 16, 2013
1 parent d78c221 commit d248043
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ClosureTableBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ public function saveNodeAsRoot($runValidation = true, $attributes = null)
}
try {
if (!$owner->save($runValidation, $attributes)) {
if (isset($transaction)) {
$transaction->rollback();
}
return false;
}
$this->markAsRoot($owner->primaryKey);
Expand Down

0 comments on commit d248043

Please sign in to comment.