summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2023-06-19 16:46:01 +0200
committerGitHub <noreply@github.com>2023-06-19 16:46:01 +0200
commit989721bca688b0a49180768f366c3c50d67d6ae6 (patch)
tree6a993308b0cd53fbc1f2d979a506ebdb846f04cb
parente9884bd6708d785846ed1c3337a7a28457a7015b (diff)
parent3e46f6289f644a2e197c2106d6ce7295d43a1fdf (diff)
downloadnextcloud-server-989721bca688b0a49180768f366c3c50d67d6ae6.tar.gz
nextcloud-server-989721bca688b0a49180768f366c3c50d67d6ae6.zip
Merge pull request #38892 from nextcloud/obj-store-copy-list-source-cache-26
-rw-r--r--lib/private/Files/ObjectStore/ObjectStoreStorage.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
index 4ca00cf6a16..76fd422a991 100644
--- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php
+++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
@@ -37,6 +37,7 @@ use Icewind\Streams\IteratorDirectory;
use OC\Files\Cache\Cache;
use OC\Files\Cache\CacheEntry;
use OC\Files\Storage\PolyFill\CopyDirectory;
+use OCP\Files\Cache\ICache;
use OCP\Files\Cache\ICacheEntry;
use OCP\Files\FileInfo;
use OCP\Files\GenericFileException;
@@ -570,7 +571,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil
if (is_array($sourceEntryData) && array_key_exists('scan_permissions', $sourceEntryData)) {
$sourceEntry['permissions'] = $sourceEntryData['scan_permissions'];
}
- $this->copyInner($sourceEntry, $targetInternalPath);
+ $this->copyInner($sourceStorage->getCache(), $sourceEntry, $targetInternalPath);
return true;
}
}
@@ -588,12 +589,12 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil
throw new NotFoundException('Source object not found');
}
- $this->copyInner($sourceEntry, $target);
+ $this->copyInner($cache, $sourceEntry, $target);
return true;
}
- private function copyInner(ICacheEntry $sourceEntry, string $to) {
+ private function copyInner(ICache $sourceCache, ICacheEntry $sourceEntry, string $to) {
$cache = $this->getCache();
if ($sourceEntry->getMimeType() === FileInfo::MIMETYPE_FOLDER) {
@@ -602,8 +603,8 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil
}
$this->mkdir($to);
- foreach ($cache->getFolderContentsById($sourceEntry->getId()) as $child) {
- $this->copyInner($child, $to . '/' . $child->getName());
+ foreach ($sourceCache->getFolderContentsById($sourceEntry->getId()) as $child) {
+ $this->copyInner($sourceCache, $child, $to . '/' . $child->getName());
}
} else {
$this->copyFile($sourceEntry, $to);