diff --git a/app/Http/Controllers/Admin/CategoryController.php b/app/Http/Controllers/Admin/CategoryController.php index d68be70..c29f655 100644 --- a/app/Http/Controllers/Admin/CategoryController.php +++ b/app/Http/Controllers/Admin/CategoryController.php @@ -58,7 +58,9 @@ class CategoryController extends XController $category->subtitle = $request->input('subtitle'); $category->icon = $request->input('icon'); $category->description = $request->input('description'); - if ($category->parent_id == ''){ + if ($request->input('parent_id') == ''){ + $category->parent_id = null; + }else{ $category->parent_id = $request->input('parent_id',null); } if ($request->has('canonical') && trim($request->input('canonical')) != ''){ diff --git a/app/Http/Controllers/Admin/GroupController.php b/app/Http/Controllers/Admin/GroupController.php index 51a4ee1..5619cf0 100644 --- a/app/Http/Controllers/Admin/GroupController.php +++ b/app/Http/Controllers/Admin/GroupController.php @@ -56,9 +56,13 @@ class GroupController extends XController $group->name = $request->input('name'); $group->subtitle = $request->input('subtitle'); $group->description = $request->input('description'); - if ($group->parent_id == ''){ + + if ($request->input('parent_id') == ''){ + $group->parent_id = null; + }else{ $group->parent_id = $request->input('parent_id',null); } + if ($request->has('canonical') && trim($request->input('canonical')) != ''){ $group->canonical = $request->input('canonical'); }