Skip to content

Commit 8f3217b

Browse files
Merge pull request #54997 from nextcloud/revert-backport/54950/stable31
[stable31] Revert "fix(files_trashbin): Fix size propagation when moving file to trash"
2 parents 808cb1f + 48fe23e commit 8f3217b

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

apps/files_trashbin/lib/Trashbin.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,8 @@ public static function move2trash($file_path, $ownerOnly = false) {
293293
try {
294294
$moveSuccessful = true;
295295

296-
$inCache = $sourceStorage->getCache()->inCache($sourceInternalPath);
297296
$trashStorage->moveFromStorage($sourceStorage, $sourceInternalPath, $trashInternalPath);
298-
if ($inCache) {
297+
if ($sourceStorage->getCache()->inCache($sourceInternalPath)) {
299298
$trashStorage->getUpdater()->renameFromStorage($sourceStorage, $sourceInternalPath, $trashInternalPath);
300299
}
301300
} catch (CopyRecursiveException $e) {

apps/files_trashbin/tests/TrashbinTest.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
use OCP\AppFramework\Utility\ITimeFactory;
2020
use OCP\Constants;
2121
use OCP\Files\FileInfo;
22-
use OCP\Files\IRootFolder;
2322
use OCP\IConfig;
24-
use OCP\Server;
2523
use OCP\Share\IShare;
2624

2725
/**
@@ -666,28 +664,6 @@ public function testRestoreFileIntoReadOnlySourceFolder(): void {
666664
}
667665
}
668666

669-
public function testTrashSizePropagation(): void {
670-
$view = new View('/' . self::TEST_TRASHBIN_USER1 . '/files_trashbin/files');
671-
672-
$userFolder = Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
673-
$file1 = $userFolder->newFile('foo.txt');
674-
$file1->putContent('1');
675-
676-
$this->assertTrue($userFolder->nodeExists('foo.txt'));
677-
$file1->delete();
678-
$this->assertFalse($userFolder->nodeExists('foo.txt'));
679-
$this->assertEquals(1, $view->getFileInfo('')->getSize());
680-
681-
$folder = $userFolder->newFolder('bar');
682-
$file2 = $folder->newFile('baz.txt');
683-
$file2->putContent('22');
684-
685-
$this->assertTrue($userFolder->nodeExists('bar'));
686-
$folder->delete();
687-
$this->assertFalse($userFolder->nodeExists('bar'));
688-
$this->assertEquals(3, $view->getFileInfo('')->getSize());
689-
}
690-
691667
/**
692668
* @param string $user
693669
* @param bool $create

0 commit comments

Comments
 (0)