Emplty Layout Hotfix
When creating new pages, there is no layout, so the system was pushing a null error when trying to use string_contains and a null string, so cleaned that up so it defaults to 'page' when that string is empty
This commit is contained in:
parent
3f9506ac6b
commit
405be1a6ed
2 changed files with 4 additions and 1 deletions
|
@ -112,6 +112,9 @@ class DashControl
|
||||||
case 'edit':
|
case 'edit':
|
||||||
$page = (new Book())->findPageById($uuid);
|
$page = (new Book())->findPageById($uuid);
|
||||||
$views = [];
|
$views = [];
|
||||||
|
if (!isset($page['layout'])) {
|
||||||
|
$page['layout'] = "page";
|
||||||
|
}
|
||||||
if (str_contains($page['layout'], 'index')) {
|
if (str_contains($page['layout'], 'index')) {
|
||||||
$views = (new Themes())->getCustomIndex();
|
$views = (new Themes())->getCustomIndex();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -107,7 +107,7 @@ class Render
|
||||||
}
|
}
|
||||||
|
|
||||||
$template = $layout . '.twig';
|
$template = $layout . '.twig';
|
||||||
if (str_contains($page['layout'], 'index')) {
|
if (str_contains($layout, 'index')) {
|
||||||
$location = '../public/index.html';
|
$location = '../public/index.html';
|
||||||
$dir = null;
|
$dir = null;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue