]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix shared storage numeric id 4004/head
authorRobin Appelman <robin@icewind.nl>
Mon, 27 Mar 2017 12:05:01 +0000 (14:05 +0200)
committerRobin Appelman <robin@icewind.nl>
Mon, 27 Mar 2017 12:05:18 +0000 (14:05 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/files_sharing/lib/Cache.php
apps/files_sharing/lib/SharedStorage.php
apps/files_sharing/tests/CacheTest.php

index bc10ddbd94f0144e4e6351a331d4af4d5fda51c1..d7dcb426d855b1f2fce5e5b0f24b43e2567680d1 100644 (file)
@@ -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()
index 888cbfda143ce8d7771ea2b854163a655b593f01..4efea477e96a2221914d2c2cece69d29ffb7443f 100644 (file)
@@ -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;
index 10db4104aae80107624159de4a51828283397083..26ba5b21e4634321544c961146bdb9e56b01df35 100644 (file)
@@ -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());