Skip to content

Commit

Permalink
Set parent to null if parent is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdekruijk committed Aug 19, 2022
1 parent 8290c40 commit 1520f50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Controllers/ModelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public function changeParent($slug, Request $request, $id)
if ($row->parent != $oldparent) return ('Invalid oldparent "' . $row->parent . '" != "' . $oldparent . '"');

// Save the new parent
$row->parent = $parent;
$row->parent = $parent === 0 ? null : $parent;
$row->save();

// Now sort the items too
Expand Down

0 comments on commit 1520f50

Please sign in to comment.