diff --git a/lib/private/Files/Node/LazyFolder.php b/lib/private/Files/Node/LazyFolder.php index 7d5038e85a25e..1bae0f52e5915 100644 --- a/lib/private/Files/Node/LazyFolder.php +++ b/lib/private/Files/Node/LazyFolder.php @@ -23,6 +23,7 @@ * along with this program. If not, see . * */ + namespace OC\Files\Node; use OC\Files\Utils\PathHelper; @@ -310,6 +311,9 @@ public function getUserFolder($userId) { * @inheritDoc */ public function getMimetype() { + if (isset($this->data['mimetype'])) { + return $this->data['mimetype']; + } return $this->__call(__FUNCTION__, func_get_args()); } @@ -317,6 +321,10 @@ public function getMimetype() { * @inheritDoc */ public function getMimePart() { + if (isset($this->data['mimetype'])) { + [$part,] = explode('/', $this->data['mimetype']); + return $part; + } return $this->__call(__FUNCTION__, func_get_args()); } @@ -331,6 +339,9 @@ public function isEncrypted() { * @inheritDoc */ public function getType() { + if (isset($this->data['type'])) { + return $this->data['type']; + } return $this->__call(__FUNCTION__, func_get_args()); } diff --git a/lib/private/Files/Node/LazyUserFolder.php b/lib/private/Files/Node/LazyUserFolder.php index d91759117c1b4..c85a356ddd324 100644 --- a/lib/private/Files/Node/LazyUserFolder.php +++ b/lib/private/Files/Node/LazyUserFolder.php @@ -23,6 +23,7 @@ namespace OC\Files\Node; +use OCP\Files\FileInfo; use OCP\Constants; use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; @@ -49,6 +50,8 @@ public function __construct(IRootFolder $rootFolder, IUser $user) { }, [ 'path' => $this->path, 'permissions' => Constants::PERMISSION_ALL, + 'type' => FileInfo::TYPE_FOLDER, + 'mimetype' => FileInfo::MIMETYPE_FOLDER, ]); } diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php index d091b5c5e358d..e0575ea92a58e 100644 --- a/lib/private/Files/SetupManager.php +++ b/lib/private/Files/SetupManager.php @@ -368,8 +368,12 @@ public function setupForPath(string $path, bool $includeChildren = false): void } // for the user's home folder, it's always the home mount - if (rtrim($path) === "/" . $user->getUID() . "/files" && !$includeChildren) { - $this->oneTimeUserSetup($user); + if (rtrim($path) === "/" . $user->getUID() . "/files") { + if ($includeChildren) { + $this->setupForUser($user); + } else { + $this->oneTimeUserSetup($user); + } return; } @@ -460,6 +464,7 @@ public function setupForProvider(string $path, array $providers): void { if (in_array('', $providers)) { $this->setupForUser($user); + return; } $setupProviders = $this->setupUserMountProviders[$user->getUID()] ?? [];