summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-08-25 18:06:13 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-08-30 19:49:23 +0200
commit669b0bc2ae6198a8f656f450ffbf351fb208951d (patch)
treed056060042d3dcbaa4a6ea429c28ca1d44014d8c
parentd17e126330617df9c19ca593cc54d56d960a4504 (diff)
downloadnextcloud-server-669b0bc2ae6198a8f656f450ffbf351fb208951d.tar.gz
nextcloud-server-669b0bc2ae6198a8f656f450ffbf351fb208951d.zip
Prevent error with orphaned shares when updating user mount cache
-rw-r--r--apps/files_sharing/lib/SharedMount.php7
-rw-r--r--lib/private/Files/Config/UserMountCache.php3
2 files changed, 8 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/SharedMount.php b/apps/files_sharing/lib/SharedMount.php
index 2b562c4b4f1..c83a28d4c5e 100644
--- a/apps/files_sharing/lib/SharedMount.php
+++ b/apps/files_sharing/lib/SharedMount.php
@@ -246,6 +246,11 @@ 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();
+ 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());
}
}