fix shared storage numeric id
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
869ba16273
commit
ae3016959e
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue