aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-05-02 17:47:11 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2013-05-02 17:47:11 -0400
commit7039421efc80f3551026d3f16ba6887e7be02234 (patch)
tree337169030bac344b8e951cf916ec63ea913faae3
parent8a5e88b21cf95f8d0f964ee012f15e447644a10f (diff)
downloadnextcloud-server-7039421efc80f3551026d3f16ba6887e7be02234.tar.gz
nextcloud-server-7039421efc80f3551026d3f16ba6887e7be02234.zip
Fix retrieving of mount points for shared storage, fix #3218
-rw-r--r--apps/files_sharing/lib/cache.php27
-rw-r--r--apps/files_sharing/lib/sharedstorage.php4
-rw-r--r--lib/files/filesystem.php2
3 files changed, 27 insertions, 6 deletions
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index 1cb457cb987..2160fe9a393 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -45,8 +45,8 @@ class Shared_Cache extends Cache {
if (isset($source['path']) && isset($source['fileOwner'])) {
\OC\Files\Filesystem::initMountPoints($source['fileOwner']);
$mount = \OC\Files\Filesystem::getMountByNumericId($source['storage']);
- if ($mount) {
- $fullPath = $mount->getMountPoint().$source['path'];
+ if (is_array($mount)) {
+ $fullPath = $mount[key($mount)]->getMountPoint().$source['path'];
list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($fullPath);
if ($storage) {
$this->files[$target] = $internalPath;
@@ -60,6 +60,14 @@ class Shared_Cache extends Cache {
return false;
}
+ public function getNumericStorageId() {
+ if (isset($this->numericId)) {
+ return $this->numericId;
+ } else {
+ return false;
+ }
+ }
+
/**
* get the stored metadata of a file or folder
*
@@ -267,4 +275,17 @@ class Shared_Cache extends Cache {
return \OCP\Share::getItemsSharedWith('file', \OC_Share_Backend_File::FORMAT_GET_ALL);
}
-}
+ /**
+ * find a folder in the cache which has not been fully scanned
+ *
+ * If multiply incomplete folders are in the cache, the one with the highest id will be returned,
+ * use the one with the highest id gives the best result with the background scanner, since that is most
+ * likely the folder where we stopped scanning previously
+ *
+ * @return string|bool the path of the folder or false when no folder matched
+ */
+ public function getIncomplete() {
+ return false;
+ }
+
+} \ No newline at end of file
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 2facad0f7e2..5c23a9eb0d0 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -72,8 +72,8 @@ class Shared extends \OC\Files\Storage\Common {
if (!isset($source['fullPath'])) {
\OC\Files\Filesystem::initMountPoints($source['fileOwner']);
$mount = \OC\Files\Filesystem::getMountByNumericId($source['storage']);
- if ($mount) {
- $this->files[$target]['fullPath'] = $mount->getMountPoint().$source['path'];
+ if (is_array($mount)) {
+ $this->files[$target]['fullPath'] = $mount[key($mount)]->getMountPoint().$source['path'];
} else {
$this->files[$target]['fullPath'] = false;
}
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php
index ad21a98fabc..eadd8a93faf 100644
--- a/lib/files/filesystem.php
+++ b/lib/files/filesystem.php
@@ -199,7 +199,7 @@ class Filesystem {
* @return Mount\Mount[]
*/
public static function getMountByNumericId($id) {
- return self::$mounts->findByStorageId($id);
+ return self::$mounts->findByNumericId($id);
}
/**