diff options
author | Robin Appelman <robin@icewind.nl> | 2021-03-08 18:50:33 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-03-16 16:17:57 +0000 |
commit | 719db4cee9dc7b738875e80e280057940fd5fd6a (patch) | |
tree | 5d18641a6f3be5633e3a2531592082b1b4ce6853 /lib/private/Files/ObjectStore | |
parent | bb180a95bb8b23464f6042264789ab710dad358a (diff) | |
download | nextcloud-server-719db4cee9dc7b738875e80e280057940fd5fd6a.tar.gz nextcloud-server-719db4cee9dc7b738875e80e280057940fd5fd6a.zip |
use returned file id for object store copy
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/ObjectStore')
-rw-r--r-- | lib/private/Files/ObjectStore/ObjectStoreStorage.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 3378f00c4dd..f68c01a38d5 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -33,6 +33,7 @@ namespace OC\Files\ObjectStore; use Icewind\Streams\CallbackWrapper; use Icewind\Streams\CountWrapper; use Icewind\Streams\IteratorDirectory; +use OC\Files\Cache\Cache; use OC\Files\Cache\CacheEntry; use OC\Files\Storage\PolyFill\CopyDirectory; use OCP\Files\Cache\ICacheEntry; @@ -567,14 +568,13 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { $sourceUrn = $this->getURN($sourceEntry->getId()); - $cache->copyFromCache($cache, $sourceEntry, $to); - $targetEntry = $cache->get($to); - - if (!$targetEntry) { - throw new \Exception('Target not in cache after copy'); + if (!$cache instanceof Cache) { + throw new \Exception("Invalid source cache for object store copy"); } - $targetUrn = $this->getURN($targetEntry->getId()); + $targetId = $cache->copyFromCache($cache, $sourceEntry, $to); + + $targetUrn = $this->getURN($targetId); try { $this->objectStore->copyObject($sourceUrn, $targetUrn); |