Merge pull request #3038 from nextcloud/bugfix/noid/attachment-get-node
This commit is contained in:
@@ -125,7 +125,11 @@ class FilesAppService implements IAttachmentService, ICustomAttachmentService {
|
|||||||
public function extendData(Attachment $attachment) {
|
public function extendData(Attachment $attachment) {
|
||||||
$userFolder = $this->rootFolder->getUserFolder($this->userId);
|
$userFolder = $this->rootFolder->getUserFolder($this->userId);
|
||||||
$share = $this->shareProvider->getShareById($attachment->getId());
|
$share = $this->shareProvider->getShareById($attachment->getId());
|
||||||
$file = $share->getNode();
|
$files = $userFolder->getById($share->getNode()->getId());
|
||||||
|
if (count($files) === 0) {
|
||||||
|
return $attachment;
|
||||||
|
}
|
||||||
|
$file = array_shift($files);
|
||||||
$attachment->setExtendedData([
|
$attachment->setExtendedData([
|
||||||
'path' => $userFolder->getRelativePath($file->getPath()),
|
'path' => $userFolder->getRelativePath($file->getPath()),
|
||||||
'fileid' => $file->getId(),
|
'fileid' => $file->getId(),
|
||||||
|
|||||||
Reference in New Issue
Block a user