Commit 7cc1208f authored by jaapjansma's avatar jaapjansma

Fixed issue with upload custom file for events

parent 55610c56
......@@ -56,7 +56,7 @@ class UploadCustomFileField extends AbstractAction {
if ($uploadNewOne) {
$attachmentParams = [
'entity_table' => 'civicrm_event',
'field_name' => 'custom_'.$customFieldId,
'entity_id' => $event_id,
'name' => $file['name'],
'content' => base64_decode($file['content']),
......@@ -64,7 +64,7 @@ class UploadCustomFileField extends AbstractAction {
'check_permissions' => FALSE,
];
$result = civicrm_api3('Attachment', 'create', $attachmentParams);
$updateCustomField = $result['id'];
$updateCustomField = false; //Code above updates the custom field.
}
if ($updateCustomField) {
civicrm_api3('Event', 'create', [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment