File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
apps/files_external/lib/Lib/Storage Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -311,13 +311,35 @@ private function batchDelete($path = null) {
311311 $ connection ->deleteObjects ([
312312 'Bucket ' => $ this ->bucket ,
313313 'Delete ' => [
314- 'Objects ' => $ objects ['Contents ' ]
314+ 'Objects ' => $ objects ['Contents ' ],
315315 ]
316316 ]);
317317 $ this ->testTimeout ();
318318 }
319319 // we reached the end when the list is no longer truncated
320320 } while ($ objects ['IsTruncated ' ]);
321+
322+ do {
323+ // delete all contained versions and deletion markers
324+ $ objects = $ connection ->listObjectVersions ($ params );
325+ if (isset ($ objects ['Versions ' ])) {
326+ $ connection ->deleteObjects ([
327+ 'Bucket ' => $ this ->bucket ,
328+ 'Delete ' => [
329+ 'Objects ' => $ objects ['Versions ' ],
330+ ]
331+ ]);
332+ }
333+ if (isset ($ objects ['DeleteMarkers ' ])) {
334+ $ connection ->deleteObjects ([
335+ 'Bucket ' => $ this ->bucket ,
336+ 'Delete ' => [
337+ 'Objects ' => $ objects ['DeleteMarkers ' ],
338+ ]
339+ ]);
340+ }
341+ // we reached the end when the list is no longer truncated
342+ } while ($ objects ['IsTruncated ' ]);
321343 $ this ->deleteObject ($ path );
322344 } catch (S3Exception $ e ) {
323345 \OC ::$ server ->getLogger ()->logException ($ e , ['app ' => 'files_external ' ]);
You can’t perform that action at this time.
0 commit comments