fixed bug parent

master
A1Gard 2 weeks ago
parent 8217e109d5
commit 7fd5388929

@ -58,7 +58,9 @@ class CategoryController extends XController
$category->subtitle = $request->input('subtitle'); $category->subtitle = $request->input('subtitle');
$category->icon = $request->input('icon'); $category->icon = $request->input('icon');
$category->description = $request->input('description'); $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); $category->parent_id = $request->input('parent_id',null);
} }
if ($request->has('canonical') && trim($request->input('canonical')) != ''){ if ($request->has('canonical') && trim($request->input('canonical')) != ''){

@ -56,9 +56,13 @@ class GroupController extends XController
$group->name = $request->input('name'); $group->name = $request->input('name');
$group->subtitle = $request->input('subtitle'); $group->subtitle = $request->input('subtitle');
$group->description = $request->input('description'); $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); $group->parent_id = $request->input('parent_id',null);
} }
if ($request->has('canonical') && trim($request->input('canonical')) != ''){ if ($request->has('canonical') && trim($request->input('canonical')) != ''){
$group->canonical = $request->input('canonical'); $group->canonical = $request->input('canonical');
} }

Loading…
Cancel
Save