Skip to content
Snippets Groups Projects
Commit 0342ab2e authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

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

parent 667582fc
No related branches found
No related tags found
No related merge requests found
...@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment