From bdc86e9486ca966ace85648d1f8f56198ddd0253 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 8 Apr 2022 15:04:35 +0200 Subject: [PATCH 1/3] add missing return Signed-off-by: Robin Appelman --- lib/private/Files/SetupManager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php index d091b5c5e358d..204d057a240ce 100644 --- a/lib/private/Files/SetupManager.php +++ b/lib/private/Files/SetupManager.php @@ -460,6 +460,7 @@ public function setupForProvider(string $path, array $providers): void { if (in_array('', $providers)) { $this->setupForUser($user); + return; } $setupProviders = $this->setupUserMountProviders[$user->getUID()] ?? []; From 54e52e9b5e569942f9daa7f00876006e90736a61 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 8 Apr 2022 15:05:43 +0200 Subject: [PATCH 2/3] always do full setup for home folder with submounts Signed-off-by: Robin Appelman --- lib/private/Files/SetupManager.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php index 204d057a240ce..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; } From 499749dbc1dc3be1b223914926f3889883987d1e Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 8 Apr 2022 15:09:40 +0200 Subject: [PATCH 3/3] more preset metadata for LazyUserFolder Signed-off-by: Robin Appelman --- lib/private/Files/Node/LazyFolder.php | 11 +++++++++++ lib/private/Files/Node/LazyUserFolder.php | 3 +++ 2 files changed, 14 insertions(+) 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, ]); }