ensure we don't change page type when it's empty

This commit is contained in:
Andy Miller
2015-08-05 18:09:08 -06:00
parent 6f4783e236
commit 5ca737b8de

View File

@@ -1107,8 +1107,8 @@ class AdminController
$page->folder($ordering . $slug);
if (isset($input['type'])) {
$type = (string) $input['type'];
if (isset($input['type']) && !empty($input['type'])) {
$type = (string) strtolower($input['type']);
$name = preg_replace('|.*/|', '', $type) . '.md';
$page->name($name);
$page->template($type);