diff --git a/core/Command/Info/FileUtils.php b/core/Command/Info/FileUtils.php index df7dba175ba24..5de5f5fcaa623 100644 --- a/core/Command/Info/FileUtils.php +++ b/core/Command/Info/FileUtils.php @@ -46,13 +46,12 @@ public function getFilesByUser(FileInfo $file): array { $mounts = $this->userMountCache->getMountsForFileId($id); $result = []; - foreach ($mounts as $mount) { - if (isset($result[$mount->getUser()->getUID()])) { - continue; - } - - $userFolder = $this->rootFolder->getUserFolder($mount->getUser()->getUID()); - $result[$mount->getUser()->getUID()] = $userFolder->getById($id); + foreach ($mounts as $cachedMount) { + $mount = $this->rootFolder->getMount($cachedMount->getMountPoint()); + $cache = $mount->getStorage()->getCache(); + $cacheEntry = $cache->get($id); + $node = $this->rootFolder->getNodeFromCacheEntryAndMount($cacheEntry, $mount); + $result[$cachedMount->getUser()->getUID()][] = $node; } return $result; diff --git a/lib/private/Files/Node/Root.php b/lib/private/Files/Node/Root.php index 1686051131dac..d4ec241654b81 100644 --- a/lib/private/Files/Node/Root.php +++ b/lib/private/Files/Node/Root.php @@ -522,9 +522,9 @@ public function getNodeFromCacheEntryAndMount(ICacheEntry $cacheEntry, IMountPoi $isDir = $info->getType() === FileInfo::TYPE_FOLDER; $view = new View(''); if ($isDir) { - return new Folder($this, $view, $path, $info, $parent); + return new Folder($this, $view, $fullPath, $info, $parent); } else { - return new File($this, $view, $path, $info, $parent); + return new File($this, $view, $fullPath, $info, $parent); } } }