}
$sortName = $displayName = '';
- $firstName = CRM_Utils_Array::value('first_name', $params, '');
- $middleName = CRM_Utils_Array::value('middle_name', $params, '');
- $lastName = CRM_Utils_Array::value('last_name', $params, '');
+ $firstName = trim($params['first_name'] ?? '');
+ $middleName = trim($params['middle_name'] ?? '');
+ $lastName = trim($params['last_name'] ?? '');
$nickName = CRM_Utils_Array::value('nick_name', $params, '');
$prefix_id = CRM_Utils_Array::value('prefix_id', $params, '');
$suffix_id = CRM_Utils_Array::value('suffix_id', $params, '');
}
}
- //first trim before further processing.
- foreach (['lastName', 'firstName', 'middleName'] as $fld) {
- $$fld = trim($$fld);
- }
-
if ($lastName || $firstName || $middleName) {
// make sure we have values for all the name fields.
$formatted = $params;
}
}
}
- $uniqId = CRM_Utils_Array::value('user_unique_id', $params);
+ $uniqId = $params['user_unique_id'] ?? NULL;
if (!$email && $contact->id) {
$email = CRM_Contact_BAO_Contact::getPrimaryEmail($contact->id);
}