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>
pull/52242/head
Louis Chemineau 5 months ago committed by Louis
parent 9530277f20
commit 1f8b823992
  1. 4
      lib/private/Files/ObjectStore/ObjectStoreStorage.php

@ -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());

Loading…
Cancel
Save