From 8276d951fc1ab00e3b6b989fb3f2b594d41ba3a9 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 13 Aug 2019 16:52:18 -0400 Subject: [PATCH] Fix backward compat issues with file hash --- includes/wf_crm_webform_base.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/wf_crm_webform_base.inc b/includes/wf_crm_webform_base.inc index c8fc31309..5a6124e1a 100755 --- a/includes/wf_crm_webform_base.inc +++ b/includes/wf_crm_webform_base.inc @@ -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'])), ); }