aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-03-27 14:05:01 +0200
committerRobin Appelman <robin@icewind.nl>2017-03-27 14:05:18 +0200
commitae3016959e6cbcadcd5169fa9e35a332abcc4495 (patch)
treea9f80ec1a610c8480c3a3a0ccad901b50f1b0651
parent869ba16273ededa4637c5ddeaab11533fb4e455f (diff)
downloadnextcloud-server-ae3016959e6cbcadcd5169fa9e35a332abcc4495.tar.gz
nextcloud-server-ae3016959e6cbcadcd5169fa9e35a332abcc4495.zip
fix shared storage numeric id
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--apps/files_sharing/lib/Cache.php3
-rw-r--r--apps/files_sharing/lib/SharedStorage.php5
-rw-r--r--apps/files_sharing/tests/CacheTest.php3
3 files changed, 11 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php
index bc10ddbd94f..d7dcb426d85 100644
--- a/apps/files_sharing/lib/Cache.php
+++ b/apps/files_sharing/lib/Cache.php
@@ -51,6 +51,8 @@ class Cache extends CacheJail {
private $ownerDisplayName;
+ private $numericId;
+
/**
* @param \OCA\Files_Sharing\SharedStorage $storage
* @param ICacheEntry $sourceRootInfo
@@ -58,6 +60,7 @@ class Cache extends CacheJail {
public function __construct($storage, ICacheEntry $sourceRootInfo) {
$this->storage = $storage;
$this->sourceRootInfo = $sourceRootInfo;
+ $this->numericId = $sourceRootInfo->getStorageId();
parent::__construct(
null,
$this->sourceRootInfo->getPath()
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php
index 888cbfda143..4efea477e96 100644
--- a/apps/files_sharing/lib/SharedStorage.php
+++ b/apps/files_sharing/lib/SharedStorage.php
@@ -337,6 +337,11 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
return $this->superShare->getNodeType();
}
+ /**
+ * @param string $path
+ * @param null $storage
+ * @return Cache
+ */
public function getCache($path = '', $storage = null) {
if ($this->cache) {
return $this->cache;
diff --git a/apps/files_sharing/tests/CacheTest.php b/apps/files_sharing/tests/CacheTest.php
index 10db4104aae..26ba5b21e46 100644
--- a/apps/files_sharing/tests/CacheTest.php
+++ b/apps/files_sharing/tests/CacheTest.php
@@ -30,6 +30,8 @@
namespace OCA\Files_Sharing\Tests;
+use OCA\Files_Sharing\SharedStorage;
+
/**
* Class CacheTest
*
@@ -545,6 +547,7 @@ class CacheTest extends TestCase {
self::loginHelper(self::TEST_FILES_SHARING_API_USER2);
$this->assertTrue(\OC\Files\Filesystem::file_exists('/foo'));
+ /** @var SharedStorage $sharedStorage */
list($sharedStorage) = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/foo');
$this->assertEquals($sourceStorage->getCache()->getNumericStorageId(), $sharedStorage->getCache()->getNumericStorageId());