FEATURE: json_decode widget settings before calling handler
This commit is contained in:
@@ -19,6 +19,7 @@ class EditWidget extends Controller
|
|||||||
public function getEdit($id)
|
public function getEdit($id)
|
||||||
{
|
{
|
||||||
$widget = Widget::findOrFail($id);
|
$widget = Widget::findOrFail($id);
|
||||||
|
$widget->settings = json_decode($widget->settings);
|
||||||
|
|
||||||
$presenter = call_user_func([$widget->widget_type_handler, 'getPresenter']);
|
$presenter = call_user_func([$widget->widget_type_handler, 'getPresenter']);
|
||||||
|
|
||||||
@@ -40,11 +41,9 @@ class EditWidget extends Controller
|
|||||||
|
|
||||||
// update name
|
// update name
|
||||||
$widget->name = $request->name;
|
$widget->name = $request->name;
|
||||||
|
$widget->container_class = $request->containerClass;
|
||||||
// save description if available
|
$widget->container_id = $request->containerId;
|
||||||
if (isset($request->description)) {
|
|
||||||
$widget->description = $request->description;
|
$widget->description = $request->description;
|
||||||
}
|
|
||||||
|
|
||||||
// try to save this widget
|
// try to save this widget
|
||||||
try {
|
try {
|
||||||
@@ -76,7 +75,8 @@ class EditWidget extends Controller
|
|||||||
*
|
*
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function deleteWidget($id) {
|
public function deleteWidget($id)
|
||||||
|
{
|
||||||
// create new widget
|
// create new widget
|
||||||
$widget = Widget::findOrFail($id);
|
$widget = Widget::findOrFail($id);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user