aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/lib/Controller')
-rw-r--r--apps/files/lib/Controller/ViewController.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php
index 7931686c92e..5172194dd8b 100644
--- a/apps/files/lib/Controller/ViewController.php
+++ b/apps/files/lib/Controller/ViewController.php
@@ -226,9 +226,14 @@ class ViewController extends Controller {
// Get all the user favorites to create a submenu
try {
- $favElements = $this->activityHelper->getFavoriteFilePaths($userId);
+ $userFolder = $this->rootFolder->getUserFolder($userId);
+ $favElements = $this->activityHelper->getFavoriteNodes($userId, true);
+ $favElements = array_map(fn (Folder $node) => [
+ 'fileid' => $node->getId(),
+ 'path' => $userFolder->getRelativePath($node->getPath()),
+ ], $favElements);
} catch (\RuntimeException $e) {
- $favElements['folders'] = [];
+ $favElements = [];
}
// If the file doesn't exists in the folder and
@@ -260,7 +265,7 @@ class ViewController extends Controller {
$this->initialState->provideInitialState('storageStats', $storageInfo);
$this->initialState->provideInitialState('config', $this->userConfig->getConfigs());
$this->initialState->provideInitialState('viewConfigs', $this->viewConfig->getConfigs());
- $this->initialState->provideInitialState('favoriteFolders', $favElements['folders'] ?? []);
+ $this->initialState->provideInitialState('favoriteFolders', $favElements);
// File sorting user config
$filesSortingConfig = json_decode($this->config->getUserValue($userId, 'files', 'files_sorting_configs', '{}'), true);