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
toggle-buttons-#109
Ro 2 years ago
parent 3f9506ac6b
commit 405be1a6ed
Signed by: are0h
GPG Key ID: 29B551CDBD4D3B50

@ -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…
Cancel
Save