diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index b6e571b134ebe..07fa6b4a521ab 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -602,8 +602,8 @@ public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $t } if ($sourceCacheEntry->getMimeType() === FileInfo::MIMETYPE_FOLDER) { $this->mkdir($targetInternalPath); - foreach ($sourceCache->getFolderContents($sourceInternalPath) as $child) { - $this->moveFromStorage($sourceStorage, $child->getPath(), $targetInternalPath . '/' . $child->getName()); + foreach ($sourceCache->getFolderContentsById($sourceCacheEntry->getId()) as $child) { + $this->moveFromStorage($sourceStorage, $child->getPath(), $targetInternalPath . '/' . $child->getName(), $child); } $sourceStorage->rmdir($sourceInternalPath); } else {