From 1f8b82399292ea59882b22fc924c9bba477444e6 Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Fri, 16 May 2025 16:20:29 +0200 Subject: 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 --- lib/private/Files/ObjectStore/ObjectStoreStorage.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/private/Files/ObjectStore') diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index ebe87399ab4..02724e2e20a 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/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()); -- cgit v1.2.3