add fallback for trashbin original location
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
2767139ca9
commit
9a220214b8
|
@ -53,9 +53,13 @@ class LegacyTrashBackend implements ITrashBackend {
|
||||||
$parentTrashPath = ($parent instanceof ITrashItem) ? $parent->getTrashPath() : '';
|
$parentTrashPath = ($parent instanceof ITrashItem) ? $parent->getTrashPath() : '';
|
||||||
$isRoot = $parent === null;
|
$isRoot = $parent === null;
|
||||||
return array_map(function (FileInfo $file) use ($parent, $parentTrashPath, $isRoot, $user) {
|
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(
|
return new TrashItem(
|
||||||
$this,
|
$this,
|
||||||
$isRoot ? $file['extraData'] : $parent->getOriginalLocation() . '/' . $file->getName(),
|
$originalLocation,
|
||||||
$file->getMTime(),
|
$file->getMTime(),
|
||||||
$parentTrashPath . '/' . $file->getName() . ($isRoot ? '.d' . $file->getMtime() : ''),
|
$parentTrashPath . '/' . $file->getName() . ($isRoot ? '.d' . $file->getMtime() : ''),
|
||||||
$file,
|
$file,
|
||||||
|
|
Loading…
Reference in New Issue