diff options
author | Robin Appelman <robin@icewind.nl> | 2017-03-23 17:01:23 +0300 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2017-05-23 00:16:28 +0300 |
commit | 1fd6369a600054db8e46517c4efa77826174182c (patch) | |
tree | 5cdd0427821345f13ea7e85d2251ee584e474431 | |
parent | 0d20865548283035a43d8d9c7775437458178c28 (diff) |
set cache to failedcache when shared storage init fails
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | apps/files_sharing/lib/SharedStorage.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/tests/SharedStorageTest.php | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index 2cfba16c686..ddbc9b8a898 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -124,13 +124,16 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto } catch (NotFoundException $e) { // original file not accessible or deleted, set FailedStorage $this->storage = new FailedStorage(['exception' => $e]); + $this->cache = new FailedCache(); $this->rootPath = ''; } catch (NoUserException $e) { // sharer user deleted, set FailedStorage $this->storage = new FailedStorage(['exception' => $e]); + $this->cache = new FailedCache(); $this->rootPath = ''; } catch (\Exception $e) { $this->storage = new FailedStorage(['exception' => $e]); + $this->cache = new FailedCache(); $this->rootPath = ''; $this->logger->logException($e); } diff --git a/apps/files_sharing/tests/SharedStorageTest.php b/apps/files_sharing/tests/SharedStorageTest.php index ad6243c46b1..7d007cb6414 100644 --- a/apps/files_sharing/tests/SharedStorageTest.php +++ b/apps/files_sharing/tests/SharedStorageTest.php @@ -577,8 +577,8 @@ class SharedStorageTest extends TestCase { ]); // trigger init - $this->assertInstanceOf(\OC\Files\Cache\FailedCache::class, $storage->getCache()); $this->assertInstanceOf(\OC\Files\Storage\FailedStorage::class, $storage->getSourceStorage()); + $this->assertInstanceOf(\OC\Files\Cache\FailedCache::class, $storage->getCache()); } public function testInitWithNotFoundSource() { @@ -594,7 +594,7 @@ class SharedStorageTest extends TestCase { ]); // trigger init - $this->assertInstanceOf(\OC\Files\Cache\FailedCache::class, $storage->getCache()); $this->assertInstanceOf(\OC\Files\Storage\FailedStorage::class, $storage->getSourceStorage()); + $this->assertInstanceOf(\OC\Files\Cache\FailedCache::class, $storage->getCache()); } } |