Commit 7cc1208f authored by jaapjansma's avatar jaapjansma
Browse files

Fixed issue with upload custom file for events

parent 55610c56
...@@ -56,7 +56,7 @@ class UploadCustomFileField extends AbstractAction { ...@@ -56,7 +56,7 @@ class UploadCustomFileField extends AbstractAction {
if ($uploadNewOne) { if ($uploadNewOne) {
$attachmentParams = [ $attachmentParams = [
'entity_table' => 'civicrm_event', 'field_name' => 'custom_'.$customFieldId,
'entity_id' => $event_id, 'entity_id' => $event_id,
'name' => $file['name'], 'name' => $file['name'],
'content' => base64_decode($file['content']), 'content' => base64_decode($file['content']),
...@@ -64,7 +64,7 @@ class UploadCustomFileField extends AbstractAction { ...@@ -64,7 +64,7 @@ class UploadCustomFileField extends AbstractAction {
'check_permissions' => FALSE, 'check_permissions' => FALSE,
]; ];
$result = civicrm_api3('Attachment', 'create', $attachmentParams); $result = civicrm_api3('Attachment', 'create', $attachmentParams);
$updateCustomField = $result['id']; $updateCustomField = false; //Code above updates the custom field.
} }
if ($updateCustomField) { if ($updateCustomField) {
civicrm_api3('Event', 'create', [ 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