Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for dev/core#2948 #22022

Merged
merged 1 commit into from
Nov 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions CRM/Event/Form/Registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,12 +686,6 @@ public function confirmPostProcess($contactID = NULL, $contribution = NULL) {
$this->set('primaryParticipant', $this->_params);
}

CRM_Core_BAO_CustomValueTable::postProcess($this->_params,
'civicrm_participant',
$participant->id,
'Participant'
);

$createPayment = (CRM_Utils_Array::value('amount', $this->_params, 0) != 0) ? TRUE : FALSE;

// force to create zero amount payment, CRM-5095
Expand Down Expand Up @@ -828,6 +822,15 @@ protected function addParticipant(&$form, $contactID) {
$participantParams['discount_id'] = "null";
}

$participantParams['custom'] = [];
foreach ($form->_params as $paramName => $paramValue) {
if (strpos($paramName, 'custom_') === 0) {
list($customFieldID, $customValueID) = CRM_Core_BAO_CustomField::getKeyID($paramName, TRUE);
CRM_Core_BAO_CustomField::formatCustomField($customFieldID, $participantParams['custom'], $paramValue, 'Participant', $customValueID);

}
}

$participant = CRM_Event_BAO_Participant::create($participantParams);

$transaction->commit();
Expand Down