FIX: fix content edit
This commit is contained in:
@@ -23,9 +23,6 @@ class PageRenderer
|
||||
*/
|
||||
public static function render(Content $page)
|
||||
{
|
||||
// decode module settings
|
||||
$page->moduleSettings = json_decode($page->moduleSettings);
|
||||
|
||||
// do something template-specific
|
||||
$parameters = call_user_func_array([CurrentTemplate::handler(), 'beforeRender'], [&$page]);
|
||||
|
||||
|
||||
@@ -90,17 +90,9 @@ class Content extends Repository implements IContent
|
||||
*/
|
||||
public function getByURL($url)
|
||||
{
|
||||
$page = $this->getPageQuery()
|
||||
return $this->getPageQuery()
|
||||
->where('url', $url)
|
||||
->first();
|
||||
|
||||
if (is_null($page)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$page->moduleSettings = json_decode($page->moduleSettings);
|
||||
|
||||
return $page;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -142,23 +142,4 @@ class EditContent extends Controller
|
||||
->route('content.overview')
|
||||
->with('success', trans('admin/contents.successfullyEdited'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert object of all request data into array of only wanted fields
|
||||
*
|
||||
* @param $request
|
||||
* @param $fields
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getFields($request, $fields)
|
||||
{
|
||||
$requestData = [];
|
||||
|
||||
foreach ($fields as $field) {
|
||||
$requestData[$field] = $request->$field;
|
||||
}
|
||||
|
||||
return $requestData;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user