From a36f32b7583f89143365a6c1c6cce6ab7f38ef46 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 5 Apr 2020 10:05:21 -0400 Subject: [PATCH] Fix multiselect/checkbox custom field defaults on registration profile The CRM_Core_BAO_UFGroup::setProfileDefaults() function expects each field to be an array, but this function was just passing it the number 1. So it did not have enough field metadata to correctly format each value. --- CRM/Event/BAO/Participant.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index 8117991b40..64b2f806ce 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -1858,13 +1858,13 @@ WHERE civicrm_participant.contact_id = {$contactID} AND if (!empty($form->_fields)) { $removeCustomFieldTypes = ['Participant']; - foreach ($form->_fields as $name => $dontCare) { + foreach ($form->_fields as $name => $fieldInfo) { if ((substr($name, 0, 7) == 'custom_' && !$form->_allowConfirmation && !CRM_Core_BAO_CustomGroup::checkCustomField(substr($name, 7), $removeCustomFieldTypes)) || substr($name, 0, 12) == 'participant_') { continue; } - $fields[$name] = 1; + $fields[$name] = $fieldInfo; } if (!empty($fields)) { -- 2.25.1