Skip to content

Commit

Permalink
Fix empty IN() if there are no old closures
Browse files Browse the repository at this point in the history
  • Loading branch information
aminin authored Jul 7, 2016
1 parent 7353744 commit fb151ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Gedmo/Tree/Strategy/ORM/Closure.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ public function updateNode(EntityManager $em, $node, $oldParent)
}
// using subquery directly, sqlite acts unfriendly
$query = "DELETE FROM {$table} WHERE id IN (".implode(', ', $ids).")";
if (!$conn->executeQuery($query)) {
if (!empty($ids) && !$conn->executeQuery($query)) {
throw new RuntimeException('Failed to remove old closures');
}
}
Expand Down

0 comments on commit fb151ef

Please sign in to comment.