aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-01-29 15:14:04 +0100
committerRobin Appelman <robin@icewind.nl>2019-01-29 15:14:04 +0100
commit9a220214b88dca30997a17f822a49a40a0a0b38f (patch)
tree1298000116a5369751ae23e8b45dd16c809e4cde /apps/files_trashbin
parent2767139ca9107b0aff9cfba0e9c0674011bedece (diff)
downloadnextcloud-server-9a220214b88dca30997a17f822a49a40a0a0b38f.tar.gz
nextcloud-server-9a220214b88dca30997a17f822a49a40a0a0b38f.zip
add fallback for trashbin original location
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/lib/Trash/LegacyTrashBackend.php6
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,