Skip to content
Snippets Groups Projects
Commit 8c1908a2 authored by Uma's avatar Uma
Browse files

Fixes #1321 File Preview is Comments is supported

parent e0e1c116
No related branches found
No related tags found
No related merge requests found
......@@ -744,8 +744,11 @@ class Vtiger_Record_Model extends Vtiger_Base_Model {
function getDownloadFileURL($attachmentId = false) {
$fileDetails = $this->getFileDetails($attachmentId);
if (is_array($fileDetails[0])) {
$fileDetails = $fileDetails[0];
}
if (!empty($fileDetails)) {
return 'index.php?module='. $this->getModuleName() .'&action=DownloadFile&record='. $this->getId() .'&fileid='. $fileDetails[0]['attachmentsid'].'&name='. $fileDetails[0]['name'];
return 'index.php?module='. $this->getModuleName() .'&action=DownloadFile&record='. $this->getId() .'&fileid='. $fileDetails['attachmentsid'].'&name='. $fileDetails['name'];
} else {
return $this->get('filename');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment