summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2016-08-31 15:07:13 +0200
committerGitHub <noreply@github.com>2016-08-31 15:07:13 +0200
commita0af513a4a4adc295f5673fd7d1d7fd25c6ac75a (patch)
treee1587c68dee5e6bc2b58bacb39f1ea46455ebc23
parente4311a2ebdf3eeda8b2f1022c19290dc68db8ae5 (diff)
parent423378ea179574c6c9c272f785e94a4bdfc996bb (diff)
downloadnextcloud-server-a0af513a4a4adc295f5673fd7d1d7fd25c6ac75a.tar.gz
nextcloud-server-a0af513a4a4adc295f5673fd7d1d7fd25c6ac75a.zip
Merge pull request #1201 from nextcloud/usermountcache-orphanedshare
[master] Usermountcache orphanedshare
-rw-r--r--apps/files_sharing/lib/SharedMount.php8
-rw-r--r--lib/private/Files/Config/UserMountCache.php3
2 files changed, 9 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/SharedMount.php b/apps/files_sharing/lib/SharedMount.php
index 2b562c4b4f1..13ecd88bfa9 100644
--- a/apps/files_sharing/lib/SharedMount.php
+++ b/apps/files_sharing/lib/SharedMount.php
@@ -246,6 +246,12 @@ class SharedMount extends MountPoint implements MoveableMount {
->from('filecache')
->where($builder->expr()->eq('fileid', $builder->createNamedParameter($this->getStorageRootId())));
- return $query->execute()->fetchColumn();
+ $result = $query->execute();
+ $row = $result->fetch();
+ $result->closeCursor();
+ if ($row) {
+ return $row['storage'];
+ }
+ return -1;
}
}
diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php
index ab58a976873..bd8343fa440 100644
--- a/lib/private/Files/Config/UserMountCache.php
+++ b/lib/private/Files/Config/UserMountCache.php
@@ -159,7 +159,8 @@ class UserMountCache implements IUserMountCache {
'mount_id' => $mount->getMountId()
], ['root_id', 'user_id']);
} else {
- $this->logger->error('Error getting storage info for mount at ' . $mount->getMountPoint());
+ // in some cases this is legitimate, like orphaned shares
+ $this->logger->debug('Could not get storage info for mount at ' . $mount->getMountPoint());
}
}