else {
$contactSubType = $this->_contactSubType;
// need contact sub type to build related grouptree array during post process
- if (!empty($_POST['contact_sub_type'])) {
- $contactSubType = $_POST['contact_sub_type'];
+ if (!empty($_POST['qfKey'])) {
+ $contactSubType = $_POST['contact_sub_type'] ?? NULL;
}
//only custom data has preprocess hence directly call it
CRM_Custom_Form_CustomData::preProcess($this, NULL, $contactSubType,
$params['preferred_communication_method'] = 'null';
}
- $group = CRM_Utils_Array::value('group', $params);
+ $group = $params['group'] ?? NULL;
+ $params['group'] = ($params['group'] == '') ? [] : $params['group'];
if (!empty($group)) {
$group = is_array($group) ? $group : explode(',', $group);
- unset($params['group']);
+ $params['group'] = [];
foreach ($group as $key => $value) {
$params['group'][$value] = 1;
}