Skip to content

Commit dd47e4f

Browse files
author
Flaviu Chelaru
authored
Merge pull request #2 from P4BGroup/issue/1-bad-primary-calculations
use parent id, not parent parent_id value when deleting
2 parents e2537c7 + c0326e1 commit dd47e4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Behavior.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function processDelete(ModelInterface $model): void
160160
$model->getWriteConnection()->query($query, [
161161
'right' => $model->readAttribute(self::$rightKey),
162162
'left' => $model->readAttribute(self::$leftKey),
163-
'parent' => $parent ? $parent->readAttribute(self::$parentKey) : 0
163+
'parent' => $parent ? $parent->readAttribute(self::$primaryKey) : 0
164164
]);
165165

166166
$query = 'UPDATE `' . $model->getSource() . '` SET ' .

0 commit comments

Comments
 (0)