Skip to content

Commit

Permalink
Merge pull request #29158 from nextcloud/backport/24185/stable20
Browse files Browse the repository at this point in the history
[stable20] Properly handle folder deletion on external s3 storage
  • Loading branch information
kesselb authored Oct 15, 2021
2 parents 4a15484 + d97fc4e commit 400da85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/files_external/lib/Lib/Storage/AmazonS3.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ private function batchDelete($path = null) {
}
// we reached the end when the list is no longer truncated
} while ($objects['IsTruncated']);
$this->deleteObject($path);
} catch (S3Exception $e) {
\OC::$server->getLogger()->logException($e, ['app' => 'files_external']);
return false;
Expand Down
1 change: 1 addition & 0 deletions lib/private/Files/Storage/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $t
$dh = $sourceStorage->opendir($sourceInternalPath);
$result = $this->mkdir($targetInternalPath);
if (is_resource($dh)) {
$result = true;
while ($result and ($file = readdir($dh)) !== false) {
if (!Filesystem::isIgnoredDir($file)) {
$result &= $this->copyFromStorage($sourceStorage, $sourceInternalPath . '/' . $file, $targetInternalPath . '/' . $file);
Expand Down

0 comments on commit 400da85

Please sign in to comment.