fix(S3): Use original folder size during copy

This prevent having copied folders with a wrongly set size of 0KB.

- Fix https://github.com/nextcloud/server/issues/51916

Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
Louis Chemineau 2025-05-16 16:20:29 +02:00 committed by Louis
parent 9530277f20
commit 1f8b823992

View file

@ -710,6 +710,10 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil
$cache->remove($to);
}
$this->mkdir($to);
$cacheEntry = $cache->get(($to));
$cache->update($cacheEntry->getId(), [
'size' => $sourceEntry->getSize(),
]);
foreach ($sourceCache->getFolderContentsById($sourceEntry->getId()) as $child) {
$this->copyInner($sourceCache, $child, $to . '/' . $child->getName());