CRM_Core_Error::statusBounce(ts('A Contact with that ID does not exist: %1', [1 => $this->_contactId]));
}
- $this->_contactType = CRM_Utils_Array::value('contact_type', $defaults);
- $this->_contactSubType = CRM_Utils_Array::value('contact_sub_type', $defaults);
+ $this->_contactType = $defaults['contact_type'] ?? NULL;
+ $this->_contactSubType = $defaults['contact_sub_type'] ?? NULL;
// check for permissions
$session = CRM_Core_Session::singleton();
// retain the multiple count custom fields value
if (!empty($_POST['hidden_custom'])) {
- $customGroupCount = CRM_Utils_Array::value('hidden_custom_group_count', $_POST);
+ $customGroupCount = $_POST['hidden_custom_group_count'] ?? NULL;
if ($contactSubType = CRM_Utils_Array::value('contact_sub_type', $_POST)) {
$paramSubType = implode(',', $contactSubType);
$defaults[$name][$instance]['location_type_id'] = $locationType->id;
}
else {
- $locTypeId = isset($locationTypeKeys[$instance - 1]) ? $locationTypeKeys[$instance - 1] : $locationType->id;
+ $locTypeId = $locationTypeKeys[$instance - 1] ?? $locationType->id;
$defaults[$name][$instance]['location_type_id'] = $locTypeId;
}
$dataExists = self::blockDataExists($blockValues);
if (!$dataExists && $name == 'address') {
- $dataExists = CRM_Utils_Array::value('use_shared_address', $fields['address'][$instance]);
+ $dataExists = $fields['address'][$instance]['use_shared_address'] ?? NULL;
}
if ($dataExists) {
if ($name == 'openid' && !empty($blockValues[$name])) {
$oid = new CRM_Core_DAO_OpenID();
- $oid->openid = $openIds[$instance] = CRM_Utils_Array::value($name, $blockValues);
- $cid = isset($contactId) ? $contactId : 0;
+ $oid->openid = $openIds[$instance] = $blockValues[$name];
+ $cid = $contactId ?? 0;
if ($oid->find(TRUE) && ($oid->contact_id != $cid)) {
$errors["{$name}[$instance][openid]"] = ts('%1 already exist.', [1 => $blocks['OpenID']]);
}
$params['preferred_communication_method'] = 'null';
}
- $group = CRM_Utils_Array::value('group', $params);
+ $group = $params['group'] ?? NULL;
if (!empty($group) && is_array($group)) {
unset($params['group']);
foreach ($group as $key => $value) {
}
// main parse string.
- $parseString = CRM_Utils_Array::value($parseFieldName, $address);
+ $parseString = $address[$parseFieldName] ?? NULL;
// parse address field.
$parsedFields = CRM_Core_BAO_Address::parseStreetAddress($parseString);
$streetAddress .= ' ';
}
// CRM-17619 - if the street number suffix begins with a number, add a space
- $thesuffix = CRM_Utils_Array::value('street_number_suffix', $address);
+ $thesuffix = $address['street_number_suffix'] ?? NULL;
if ($fld === 'street_number_suffix' && $thesuffix) {
if (ctype_digit(substr($thesuffix, 0, 1))) {
$streetAddress .= ' ';