forked from laysense/laysite
Allow deleting and recreating the homepage
This commit is contained in:
@@ -157,8 +157,8 @@ final class SiteBackup
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count($tables['site_settings']) !== 1 || !in_array('home', array_column($tables['pages'], 'slug'), true)) {
|
||||
throw new RuntimeException('备份缺少站点身份或首页。');
|
||||
if (count($tables['site_settings']) !== 1) {
|
||||
throw new RuntimeException('备份缺少站点身份。');
|
||||
}
|
||||
$designs = [];
|
||||
foreach ($tables['design_presets'] as &$row) {
|
||||
@@ -198,7 +198,7 @@ final class SiteBackup
|
||||
$publishedSystemPages[$row['slug']] = $row['page_type'];
|
||||
}
|
||||
} elseif ($layout === null) {
|
||||
PageDraft::slug($row['slug'] ?? null, array_diff(PageDraft::RESERVED, ['home']));
|
||||
PageDraft::slug($row['slug'] ?? null);
|
||||
} else {
|
||||
$kind = is_int($layout) ? ($designs[$layout] ?? null) : null;
|
||||
if (!in_array($kind, ['header', 'footer'], true) || ($row['slug'] ?? null) !== LayoutPage::slug($kind, $layout)) {
|
||||
|
||||
Reference in New Issue
Block a user