From 45185fb064bf8fcbb8b529a574cf3d36887324dc Mon Sep 17 00:00:00 2001 From: Benjamin Bellamy Date: Wed, 23 Aug 2023 18:20:16 +0200 Subject: [PATCH] Fix: Sort children pages with Position field --- bl-kernel/pages.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bl-kernel/pages.class.php b/bl-kernel/pages.class.php index 3987c808..104f041e 100644 --- a/bl-kernel/pages.class.php +++ b/bl-kernel/pages.class.php @@ -657,10 +657,11 @@ class Pages extends dbJSON { $list = array(); foreach ($tmp as $key=>$fields) { if (Text::startsWith($key, $parentKey.'/')) { - array_push($list, $key); + $list[$key]=$fields['position']; } } - return $list; + natcasesort($list); + return array_keys($list); } public function sortBy()