Fix: Sort children pages with Position field

This commit is contained in:
Benjamin Bellamy 2023-08-23 18:20:16 +02:00 committed by GitHub
parent a36f2534a0
commit 45185fb064
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -657,10 +657,11 @@ class Pages extends dbJSON {
$list = array(); $list = array();
foreach ($tmp as $key=>$fields) { foreach ($tmp as $key=>$fields) {
if (Text::startsWith($key, $parentKey.'/')) { if (Text::startsWith($key, $parentKey.'/')) {
array_push($list, $key); $list[$key]=$fields['position'];
} }
} }
return $list; natcasesort($list);
return array_keys($list);
} }
public function sortBy() public function sortBy()