use returned file id for object store copy
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
bb180a95bb
commit
719db4cee9
|
@ -33,6 +33,7 @@ namespace OC\Files\ObjectStore;
|
||||||
use Icewind\Streams\CallbackWrapper;
|
use Icewind\Streams\CallbackWrapper;
|
||||||
use Icewind\Streams\CountWrapper;
|
use Icewind\Streams\CountWrapper;
|
||||||
use Icewind\Streams\IteratorDirectory;
|
use Icewind\Streams\IteratorDirectory;
|
||||||
|
use OC\Files\Cache\Cache;
|
||||||
use OC\Files\Cache\CacheEntry;
|
use OC\Files\Cache\CacheEntry;
|
||||||
use OC\Files\Storage\PolyFill\CopyDirectory;
|
use OC\Files\Storage\PolyFill\CopyDirectory;
|
||||||
use OCP\Files\Cache\ICacheEntry;
|
use OCP\Files\Cache\ICacheEntry;
|
||||||
|
@ -567,14 +568,13 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
|
||||||
|
|
||||||
$sourceUrn = $this->getURN($sourceEntry->getId());
|
$sourceUrn = $this->getURN($sourceEntry->getId());
|
||||||
|
|
||||||
$cache->copyFromCache($cache, $sourceEntry, $to);
|
if (!$cache instanceof Cache) {
|
||||||
$targetEntry = $cache->get($to);
|
throw new \Exception("Invalid source cache for object store copy");
|
||||||
|
|
||||||
if (!$targetEntry) {
|
|
||||||
throw new \Exception('Target not in cache after copy');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$targetUrn = $this->getURN($targetEntry->getId());
|
$targetId = $cache->copyFromCache($cache, $sourceEntry, $to);
|
||||||
|
|
||||||
|
$targetUrn = $this->getURN($targetId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->objectStore->copyObject($sourceUrn, $targetUrn);
|
$this->objectStore->copyObject($sourceUrn, $targetUrn);
|
||||||
|
|
Loading…
Reference in New Issue