diff --git a/src/Controllers/ModelController.php b/src/Controllers/ModelController.php index a3e9bc8..f84bae9 100644 --- a/src/Controllers/ModelController.php +++ b/src/Controllers/ModelController.php @@ -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