From ff9fff23d3ec2746880ebcc1ef1f195c17219bca Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 4 Jun 2013 12:58:35 +1200 Subject: [PATCH] CRM-12759 fix inconsistency in application of multisite setting --- CRM/Contact/BAO/Contact.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index a578df67b4..4742ec1cde 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -324,16 +324,15 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact { if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME, 'is_enabled' )) { - // in order to make sure that every contact must be added to a group (CRM-4613) - + // Enabling multisite causes the contact to be added to the domain group $domainGroupID = CRM_Core_BAO_Domain::getGroupId(); - if (CRM_Utils_Array::value('group', $params) && is_array($params['group'])) { - $grpFlp = array_flip($params['group']); - if (!array_key_exists(1, $grpFlp)) { + if(!empty($domainGroupID)){ + if (CRM_Utils_Array::value('group', $params) && is_array($params['group'])) { $params['group'][$domainGroupID] = 1; } - } - else { - $params['group'] = array($domainGroupID => 1); + else { + $params['group'] = array($domainGroupID => 1); + } } } -- 2.25.1