Handle case where $input['order'] is set but empty.

Re #628 fix issue when saving a modular child folder as 05.something
and being reset to 01.something upon save
This commit is contained in:
Flavio Copes
2016-06-21 15:38:34 +02:00
parent 88f3b8192f
commit d76e75cb04

View File

@@ -2243,7 +2243,7 @@ class AdminController
$input = (array) $this->data;
if (isset($input['order'])) {
$order = max(0, (int)isset($input['order']) ? $input['order'] : $page->value('order'));
$order = max(0, ((int)isset($input['order']) && $input['order']) ? $input['order'] : $page->value('order'));
$ordering = $order ? sprintf('%02d.', $order) : '';
$slug = empty($input['folder']) ? $page->value('folder') : (string)$input['folder'];
$page->folder($ordering . $slug);