diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-08-17 10:41:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-17 10:41:31 +0200 |
commit | 2360d880fa7c08a7280dc8889308ef5151d2bc1c (patch) | |
tree | d258d1cb3d06ac169af59d14287dcc20ad7c2694 /lib | |
parent | a206b34d88d33b22182fc05a243c17bc398609b5 (diff) | |
parent | 887952b4f4761415b048ed7b453442b0ea234a21 (diff) | |
download | nextcloud-server-2360d880fa7c08a7280dc8889308ef5151d2bc1c.tar.gz nextcloud-server-2360d880fa7c08a7280dc8889308ef5151d2bc1c.zip |
Merge pull request #33540 from nextcloud/mount-provider-migration
fix updating cached mounts that didn't have their mount provider set previously
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Config/UserMountCache.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 685057a7860..3540b563742 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -90,7 +90,12 @@ class UserMountCache implements IUserMountCache { $cachedMounts = $this->getMountsForUser($user); if (is_array($mountProviderClasses)) { - $cachedMounts = array_filter($cachedMounts, function (ICachedMountInfo $mountInfo) use ($mountProviderClasses) { + $cachedMounts = array_filter($cachedMounts, function (ICachedMountInfo $mountInfo) use ($mountProviderClasses, $newMounts) { + // for existing mounts that didn't have a mount provider set + // we still want the ones that map to new mounts + if ($mountInfo->getMountProvider() === '' && isset($newMounts[$mountInfo->getRootId()])) { + return true; + } return in_array($mountInfo->getMountProvider(), $mountProviderClasses); }); } |