diff --git a/lib/Trash/TrashBackend.php b/lib/Trash/TrashBackend.php index e964815f5..6e82f8060 100644 --- a/lib/Trash/TrashBackend.php +++ b/lib/Trash/TrashBackend.php @@ -244,7 +244,8 @@ public function moveToTrash(IStorage $storage, string $internalPath): bool { // ensure the folder exists $this->getTrashFolder($folderId); - $trashFolder = $this->rootFolder->get('/' . $user->getUID() . '/files_trashbin/groupfolders/' . $folderId); + $owner = $storage->getOwner($internalPath); + $trashFolder = $this->rootFolder->get('/' . $owner . '/files_trashbin/groupfolders/' . $folderId); $trashStorage = $trashFolder->getStorage(); $time = time(); $trashName = $name . '.d' . $time;