From: Andrew Hunt Date: Sun, 26 Apr 2015 22:19:20 +0000 (-0400) Subject: CRM-13823 find status preference by name/domain combo X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=aacaa119b5199654cbec92e127138b4093809f1f;p=civicrm-core.git CRM-13823 find status preference by name/domain combo ---------------------------------------- * CRM-13823: Admin Status Page https://issues.civicrm.org/jira/browse/CRM-13823 --- diff --git a/CRM/Core/BAO/StatusPreference.php b/CRM/Core/BAO/StatusPreference.php index 6173463fa3..09cf4abd7f 100644 --- a/CRM/Core/BAO/StatusPreference.php +++ b/CRM/Core/BAO/StatusPreference.php @@ -47,8 +47,14 @@ class CRM_Core_BAO_StatusPreference extends CRM_Core_DAO_StatusPreference { */ 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); diff --git a/CRM/Utils/Check/Env.php b/CRM/Utils/Check/Env.php index 24e6331052..4e82f05f8d 100644 --- a/CRM/Utils/Check/Env.php +++ b/CRM/Utils/Check/Env.php @@ -147,12 +147,15 @@ class CRM_Utils_Check_Env { $msg = ts("Please enter your organization's name and primary address.", 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; }