CRM_Profile_Form - Add fcs for download link on custom field
authorTim Otten <totten@civicrm.org>
Wed, 13 Feb 2019 22:34:33 +0000 (14:34 -0800)
committerSeamus Lee <seamuslee001@gmail.com>
Fri, 22 Feb 2019 00:15:42 +0000 (11:15 +1100)
CRM/Profile/Form.php

index 399f189c22019c2d2628f7021fb0a30c76fedbe5..330b50890a0d3232eb4d985aa93acf6925af920d 100644 (file)
@@ -552,8 +552,9 @@ class CRM_Profile_Form extends CRM_Core_Form {
 
               $deleteExtra = ts("Are you sure you want to delete attached file?");
               $fileId = $url['file_id'];
+              $fileHash = CRM_Core_BAO_File::generateFileHash($entityId, $fileId); /* fieldId=$customFieldID */
               $deleteURL = CRM_Utils_System::url('civicrm/file',
-                "reset=1&id={$fileId}&eid=$entityId&fid={$customFieldID}&action=delete"
+                "reset=1&id={$fileId}&eid=$entityId&fid={$customFieldID}&action=delete&fcs={$fileHash}"
               );
               $text = ts("Delete Attached File");
               $customFiles[$field['name']]['deleteURL'] = "<a href=\"{$deleteURL}\" onclick = \"if (confirm( ' $deleteExtra ' )) this.href+='&amp;confirmed=1'; else return false;\">$text</a>";