diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-01-30 09:02:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-30 09:02:11 +0100 |
commit | 60ae0a475705fb146d541e3c1a1b66a091890f7b (patch) | |
tree | 5e264fb320fa8106dddab60c65158784db89bae8 | |
parent | 9d4e71f64d4baf143f2831c1ffe6c3e8f27b88db (diff) | |
parent | 9a220214b88dca30997a17f822a49a40a0a0b38f (diff) | |
download | nextcloud-server-60ae0a475705fb146d541e3c1a1b66a091890f7b.tar.gz nextcloud-server-60ae0a475705fb146d541e3c1a1b66a091890f7b.zip |
Merge pull request #13886 from nextcloud/trashbin-original-location-fallback
add fallback for trashbin original location
-rw-r--r-- | apps/files_trashbin/lib/Trash/LegacyTrashBackend.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php b/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php index b8519fa27cc..b8d51dd6681 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, |