*/
public static function create($params) {
$statusPreference = new CRM_Core_DAO_StatusPreference();
- if (array_key_exists("domain_id", $params) === FALSE) {
- $params["domain_id"] = CRM_Core_Config::domainID();
+
+ if (empty($params['id']) && CRM_Utils_Array::value('name', $params)) {
+ $searchParams = array(
+ 'domain_id' => CRM_Utils_Array::value('domain_id', $params, CRM_Core_Config::domainID()),
+ 'name' => $params['name'],
+ );
+
+ $statusPreference->find(TRUE);
}
$statusPreference->copyValues($params);
$msg = ts("Please enter your organization's <a href=\"%1\">name and primary address</a>.",
array(1 => $fixEmailUrl));
}
- $messages[] = new CRM_Utils_Check_Message(
- 'checkDomainNameEmail',
- $msg,
- ts('Complete Setup'),
- \Psr\Log\LogLevel::WARNING
- );
+
+ if (!empty($msg)) {
+ $messages[] = new CRM_Utils_Check_Message(
+ 'checkDomainNameEmail',
+ $msg,
+ ts('Complete Setup'),
+ \Psr\Log\LogLevel::WARNING
+ );
+ }
return $messages;
}