Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
noah
action-provider
Commits
7cc1208f
Commit
7cc1208f
authored
May 29, 2019
by
jaapjansma
Browse files
Fixed issue with upload custom file for events
parent
55610c56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Civi/ActionProvider/Action/Event/UploadCustomFileField.php
View file @
7cc1208f
...
@@ -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'
,
[
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment