Skip to content

Commit

Permalink
fix: use "full" target folder from user when restoring trash items
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Nov 13, 2024
1 parent d1d4a6e commit 3e0d465
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Trash/TrashBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public function restoreItem(ITrashItem $item): void {
}

$user = $item->getUser();
$userFolder = $this->rootFolder->getUserFolder($user->getUID());
[, $folderId] = explode('/', $item->getTrashPath());
$node = $this->getNodeForTrashItem($user, $item);
if ($node === null) {
Expand All @@ -119,7 +120,7 @@ public function restoreItem(ITrashItem $item): void {

$trashStorage = $node->getStorage();
/** @var Folder $targetFolder */
$targetFolder = $this->mountProvider->getFolder((int)$folderId);
$targetFolder = $userFolder->get($item->getGroupFolderMountPoint());
$originalLocation = $item->getInternalOriginalLocation();
$parent = dirname($originalLocation);
if ($parent === '.') {
Expand Down

0 comments on commit 3e0d465

Please sign in to comment.