From 9a220214b88dca30997a17f822a49a40a0a0b38f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 29 Jan 2019 15:14:04 +0100 Subject: [PATCH] add fallback for trashbin original location Signed-off-by: Robin Appelman --- apps/files_trashbin/lib/Trash/LegacyTrashBackend.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php b/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php index b8519fa27c..b8d51dd668 100644 --- a/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php +++ b/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php @@ -53,9 +53,13 @@ class LegacyTrashBackend implements ITrashBackend { $parentTrashPath = ($parent instanceof ITrashItem) ? $parent->getTrashPath() : ''; $isRoot = $parent === null; return array_map(function (FileInfo $file) use ($parent, $parentTrashPath, $isRoot, $user) { + $originalLocation = $isRoot ? $file['extraData'] : $parent->getOriginalLocation() . '/' . $file->getName(); + if (!$originalLocation) { + $originalLocation = $file->getName(); + } return new TrashItem( $this, - $isRoot ? $file['extraData'] : $parent->getOriginalLocation() . '/' . $file->getName(), + $originalLocation, $file->getMTime(), $parentTrashPath . '/' . $file->getName() . ($isRoot ? '.d' . $file->getMtime() : ''), $file,