Fix for visible state when creating new pages #1831

This commit is contained in:
Andy Miller
2020-03-06 11:17:14 -07:00
parent 5c130ccca0
commit 0f87a2691b
2 changed files with 4 additions and 3 deletions

View File

@@ -1848,7 +1848,7 @@ class Admin
$header = ['title' => $data['title']];
if (isset($data['visible'])) {
if ($data['visible'] === '' || $data['visible']) {
if ($data['visible'] === '') {
// if auto (ie '')
$pageParent = $page->parent();
$children = $pageParent ? $pageParent->children() : [];
@@ -1860,8 +1860,8 @@ class Admin
}
}
}
if ((int)$data['visible'] === 1 && !$page->order()) {
$header['visible'] = $data['visible'];
if (in_array($data['visible'], ["0", "1"])) {
$header['visible'] = (bool)$data['visible'];
}
}