summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-01-29 15:14:04 +0100
committerBackportbot <backportbot-noreply@rullzer.com>2019-01-30 08:04:49 +0000
commita6f6a3aa5d178aed52491d509a5c1bf1441ea221 (patch)
tree9e8bd22d7ed28491d8007cf56715c6b98c509541 /apps
parent95f4c2157359993ac64015410be98e292c4aca0a (diff)
downloadnextcloud-server-a6f6a3aa5d178aed52491d509a5c1bf1441ea221.tar.gz
nextcloud-server-a6f6a3aa5d178aed52491d509a5c1bf1441ea221.zip
add fallback for trashbin original location
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps')
-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,