FIX: fix editing widget with container ID

This commit is contained in:
Michal Kváček
2016-10-12 16:00:39 +02:00
parent fb51ae80ac
commit 5fd9b1871f
2 changed files with 2 additions and 2 deletions
@@ -42,7 +42,7 @@ class EditWidget extends Controller
// update name // update name
$widget->name = $request->name; $widget->name = $request->name;
$widget->container_class = $request->containerClass; $widget->container_class = $request->containerClass;
$widget->container_id = $request->containerId; $widget->container_id = empty($request->containerId) ? null : $request->containerId;
$widget->description = $request->description; $widget->description = $request->description;
// try to save this widget // try to save this widget
+1 -1
View File
@@ -13,7 +13,7 @@ class EditWidgetRequest extends Request
{ {
return [ return [
'name' => 'required', 'name' => 'required',
'containerId' => 'unique:widgets,container_id,'.$this->containerId 'containerId' => 'unique:widgets,container_id,'.$this->id
]; ];
} }
} }