From cd87a869b1d52fd65f53875527abf3205a4098a0 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 1 Jul 2021 15:08:56 +0200 Subject: Redirect to entity create form if no entity exists --- admin/post/index.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'admin/post') diff --git a/admin/post/index.php b/admin/post/index.php index e66d3b2..43d960a 100644 --- a/admin/post/index.php +++ b/admin/post/index.php @@ -28,6 +28,13 @@ $lastSite = ceil($count / $site_size); $currentSite = HTTP::GET('site') ?? 1; $currentSite = intval($currentSite); +#=============================================================================== +# Redirect to post create form if no post exists +#=============================================================================== +if(!$count) { + HTTP::redirect(Application::getAdminURL('post/insert.php')); +} + if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) { Application::error404(); } -- cgit v1.2.3