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:
Ro 2023-04-05 15:16:30 -07:00
parent 3f9506ac6b
commit 405be1a6ed
No known key found for this signature in database
GPG key ID: 29B551CDBD4D3B50
2 changed files with 4 additions and 1 deletions

View file

@ -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 {

View file

@ -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 {