diff --git a/lib/Trash/GroupTrashItem.php b/lib/Trash/GroupTrashItem.php index 7371f0487..819db698c 100644 --- a/lib/Trash/GroupTrashItem.php +++ b/lib/Trash/GroupTrashItem.php @@ -13,7 +13,7 @@ use OCP\IUser; class GroupTrashItem extends TrashItem { - private string $mountPoint; + private string $internalOriginalLocation; public function __construct( ITrashBackend $backend, @@ -22,11 +22,15 @@ public function __construct( string $trashPath, FileInfo $fileInfo, IUser $user, - string $mountPoint, - private ?IUser $deletedBy, + private string $mountPoint, + ?IUser $deletedBy, ) { - parent::__construct($backend, $originalLocation, $deletedTime, $trashPath, $fileInfo, $user, $deletedBy); - $this->mountPoint = $mountPoint; + $this->internalOriginalLocation = $originalLocation; + parent::__construct($backend, $this->mountPoint . '/' . $originalLocation, $deletedTime, $trashPath, $fileInfo, $user, $deletedBy); + } + + public function getInternalOriginalLocation(): string { + return $this->internalOriginalLocation; } public function isRootItem(): bool { diff --git a/lib/Trash/TrashBackend.php b/lib/Trash/TrashBackend.php index 2eb5cf2e0..98a27a240 100644 --- a/lib/Trash/TrashBackend.php +++ b/lib/Trash/TrashBackend.php @@ -79,7 +79,7 @@ public function listTrashFolder(ITrashItem $trashItem): array { } return new GroupTrashItem( $this, - $trashItem->getOriginalLocation() . '/' . $node->getName(), + $trashItem->getInternalOriginalLocation() . '/' . $node->getName(), $trashItem->getDeletedTime(), $trashItem->getTrashPath() . '/' . $node->getName(), $node, @@ -115,7 +115,7 @@ public function restoreItem(ITrashItem $item) { $trashStorage = $node->getStorage(); /** @var Folder $targetFolder */ $targetFolder = $this->mountProvider->getFolder((int)$folderId); - $originalLocation = $item->getOriginalLocation(); + $originalLocation = $item->getInternalOriginalLocation(); $parent = dirname($originalLocation); if ($parent === '.') { $parent = '';