Skip to content

Commit e6aef11

Browse files
authored
Merge pull request #1767 from Koc/patch-1
Closure tree - fix incorrect delete
2 parents c41e16a + a6b21c2 commit e6aef11

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/Gedmo/Tree/Strategy/ORM/Closure.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,12 @@ public function updateNode(EntityManager $em, $node, $oldParent)
440440
$ids = array_map(function ($el) {
441441
return $el['id'];
442442
}, $ids);
443-
}
444-
// using subquery directly, sqlite acts unfriendly
445-
$query = "DELETE FROM {$table} WHERE id IN (".implode(', ', $ids).")";
446-
if (!empty($ids) && !$conn->executeQuery($query)) {
447-
throw new RuntimeException('Failed to remove old closures');
443+
444+
// using subquery directly, sqlite acts unfriendly
445+
$query = "DELETE FROM {$table} WHERE id IN (".implode(', ', $ids).")";
446+
if (!empty($ids) && !$conn->executeQuery($query)) {
447+
throw new RuntimeException('Failed to remove old closures');
448+
}
448449
}
449450
}
450451

0 commit comments

Comments
 (0)