mirror of
https://github.com/nextcloud/server.git
synced 2026-06-14 19:20:35 -04:00
Sort files by deletion time before restoring in RestoreAllFiles
Restoring in order of most recently deleted preserves nested file paths. See https://github.com/nextcloud/server/issues/31200#issuecomment-1130358549 Signed-off-by: Carl Csaposs <carl@csaposs.com>
This commit is contained in:
parent
ec465bf247
commit
6f6ccfcc18
1 changed files with 5 additions and 1 deletions
|
|
@ -129,7 +129,11 @@ class RestoreAllFiles extends Base {
|
|||
\OC_Util::setupFS($uid);
|
||||
\OC_User::setUserId($uid);
|
||||
|
||||
$filesInTrash = Helper::getTrashFiles('/', $uid, 'mtime');
|
||||
// Sort by most recently deleted first
|
||||
// (Restoring in order of most recently deleted preserves nested file paths.
|
||||
// See https://github.com/nextcloud/server/issues/31200#issuecomment-1130358549)
|
||||
$filesInTrash = Helper::getTrashFiles('/', $uid, 'mtime', true);
|
||||
|
||||
$trashCount = count($filesInTrash);
|
||||
if ($trashCount == 0) {
|
||||
$output->writeln("User has no deleted files in the trashbin");
|
||||
|
|
|
|||
Loading…
Reference in a new issue