diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-12-13 14:02:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-13 14:02:49 +0100 |
commit | edd01e3ce4809e040c4a75432c531be6a80022d2 (patch) | |
tree | 0f222c5068f52be220036817ccd53e72a4d09303 /lib | |
parent | 3b3ab256a51339c0c7278274a4ba7d4835049bd9 (diff) | |
parent | 14a561ddad8bbd6ae1d524a49c70a7926c06310f (diff) | |
download | nextcloud-server-edd01e3ce4809e040c4a75432c531be6a80022d2.tar.gz nextcloud-server-edd01e3ce4809e040c4a75432c531be6a80022d2.zip |
Merge pull request #2637 from nextcloud/mount-cache-storageid
also compare storage ids when checking for changed mounts
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Cache/Cache.php | 7 | ||||
-rw-r--r-- | lib/private/Files/Config/UserMountCache.php | 7 | ||||
-rw-r--r-- | lib/private/Share20/DefaultShareProvider.php | 1 |
3 files changed, 9 insertions, 6 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 3a3f51488e6..a966d621c58 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -142,7 +142,7 @@ class Cache implements ICache { } return $data; } else { - return self::cacheEntryFromData($data, $this->storageId, $this->mimetypeLoader); + return self::cacheEntryFromData($data, $this->mimetypeLoader); } } @@ -150,11 +150,10 @@ class Cache implements ICache { * Create a CacheEntry from database row * * @param array $data - * @param string $storageId * @param IMimeTypeLoader $mimetypeLoader * @return CacheEntry */ - public static function cacheEntryFromData($data, $storageId, IMimeTypeLoader $mimetypeLoader) { + public static function cacheEntryFromData($data, IMimeTypeLoader $mimetypeLoader) { //fix types $data['fileid'] = (int)$data['fileid']; $data['parent'] = (int)$data['parent']; @@ -163,7 +162,7 @@ class Cache implements ICache { $data['storage_mtime'] = (int)$data['storage_mtime']; $data['encryptedVersion'] = (int)$data['encrypted']; $data['encrypted'] = (bool)$data['encrypted']; - $data['storage'] = $storageId; + $data['storage_id'] = $data['storage']; $data['mimetype'] = $mimetypeLoader->getMimetypeById($data['mimetype']); $data['mimepart'] = $mimetypeLoader->getMimetypeById($data['mimepart']); if ($data['storage_mtime'] == 0) { diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index c9a701d24b6..423eb5c423d 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -141,7 +141,11 @@ class UserMountCache implements IUserMountCache { foreach ($cachedMounts as $cachedMount) { if ( $newMount->getRootId() === $cachedMount->getRootId() && - ($newMount->getMountPoint() !== $cachedMount->getMountPoint() || $newMount->getMountId() !== $cachedMount->getMountId()) + ( + $newMount->getMountPoint() !== $cachedMount->getMountPoint() || + $newMount->getStorageId() !== $cachedMount->getStorageId() || + $newMount->getMountId() !== $cachedMount->getMountId() + ) ) { $changed[] = $newMount; } @@ -169,6 +173,7 @@ class UserMountCache implements IUserMountCache { $builder = $this->connection->getQueryBuilder(); $query = $builder->update('mounts') + ->set('storage_id', $builder->createNamedParameter($mount->getStorageId())) ->set('mount_point', $builder->createNamedParameter($mount->getMountPoint())) ->set('mount_id', $builder->createNamedParameter($mount->getMountId(), IQueryBuilder::PARAM_INT)) ->where($builder->expr()->eq('user_id', $builder->createNamedParameter($mount->getUser()->getUID()))) diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 7a602950171..fded7442d20 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -853,7 +853,6 @@ class DefaultShareProvider implements IShareProvider { $entryData['permissions'] = $entryData['f_permissions']; $entryData['parent'] = $entryData['f_parent'];; $share->setNodeCacheEntry(Cache::cacheEntryFromData($entryData, - $entryData['storage_string_id'], \OC::$server->getMimeTypeLoader())); } |