Skip to content

Commit

Permalink
Fix backward compat issues with file hash
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw committed Aug 13, 2019
1 parent 9bf8318 commit 8276d95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/wf_crm_webform_base.inc
Original file line number Diff line number Diff line change
Expand Up @@ -948,11 +948,11 @@ abstract class wf_crm_webform_base {
$entity_id = $this->ent[$entity][$n]['id'];
}
if (!empty($file[$val])) {
$fileHash = CRM_Core_BAO_File::generateFileHash($entity_id, $val);
$fileHash = is_callable(array('CRM_Core_BAO_File', 'generateFileHash')) ? '&fcs=' . CRM_Core_BAO_File::generateFileHash($entity_id, $val) : '';
return array(
'data_type' => 'File',
'name' => CRM_Utils_File::cleanFileName($file[$val]['uri']),
'file_url'=> CRM_Utils_System::url('civicrm/file', "reset=1&id={$val}&eid={$entity_id}&fcs={$fileHash}", TRUE),
'file_url'=> CRM_Utils_System::url('civicrm/file', "reset=1&id={$val}&eid={$entity_id}{$fileHash}", TRUE),
'icon' => file_icon_url((object) array('filemime' => $file[$val]['mime_type'])),
);
}
Expand Down

0 comments on commit 8276d95

Please sign in to comment.