mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-30 01:36:27 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user