Skip to content

Commit 6b34de3

Browse files
committed
Merge pull request civicrm#11 from ginkgostreet/status-page-1
CRM-13823 find status preference by name/domain combo
2 parents 1f9aaa5 + 7e761b8 commit 6b34de3

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

CRM/Core/BAO/StatusPreference.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,14 @@ class CRM_Core_BAO_StatusPreference extends CRM_Core_DAO_StatusPreference {
4747
*/
4848
public static function create($params) {
4949
$statusPreference = new CRM_Core_DAO_StatusPreference();
50-
if (array_key_exists("domain_id", $params) === FALSE) {
51-
$params["domain_id"] = CRM_Core_Config::domainID();
50+
51+
if (empty($params['id']) && CRM_Utils_Array::value('name', $params)) {
52+
$searchParams = array(
53+
'domain_id' => CRM_Utils_Array::value('domain_id', $params, CRM_Core_Config::domainID()),
54+
'name' => $params['name'],
55+
);
56+
57+
$statusPreference->find(TRUE);
5258
}
5359

5460
$statusPreference->copyValues($params);

CRM/Utils/Check/Env.php

+9-6
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,15 @@ public function checkDomainNameEmail() {
147147
$msg = ts("Please enter your organization's <a href=\"%1\">name and primary address</a>.",
148148
array(1 => $fixEmailUrl));
149149
}
150-
$messages[] = new CRM_Utils_Check_Message(
151-
'checkDomainNameEmail',
152-
$msg,
153-
ts('Complete Setup'),
154-
\Psr\Log\LogLevel::WARNING
155-
);
150+
151+
if (!empty($msg)) {
152+
$messages[] = new CRM_Utils_Check_Message(
153+
'checkDomainNameEmail',
154+
$msg,
155+
ts('Complete Setup'),
156+
\Psr\Log\LogLevel::WARNING
157+
);
158+
}
156159

157160
return $messages;
158161
}

0 commit comments

Comments
 (0)