Commit 0342ab2e authored by Guillaume Heurtier's avatar Guillaume Heurtier

FIX #11641 TIME 1:30 fix order of folders in tree

parent 667582fc
...@@ -74,7 +74,8 @@ class FolderController ...@@ -74,7 +74,8 @@ class FolderController
'countResources' => $count 'countResources' => $count
]; ];
if ($folder['level'] == 0) { if ($folder['level'] == 0) {
$tree[] = $insert; // $tree[] = $insert;
array_splice($tree, 0, 0, [$insert]);
} else { } else {
$found = false; $found = false;
foreach ($tree as $key => $branch) { foreach ($tree as $key => $branch) {
...@@ -632,7 +633,7 @@ class FolderController ...@@ -632,7 +633,7 @@ class FolderController
'select' => ['distinct (folders.id)', 'folders.*'], 'select' => ['distinct (folders.id)', 'folders.*'],
'where' => $where, 'where' => $where,
'data' => $data, 'data' => $data,
'orderBy' => ['level', 'label'] 'orderBy' => ['level', 'label desc']
]); ]);
return $folders; return $folders;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment