From d5a9068c1e46eda9b6841df262e9ba3ac0dd0526 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Wed, 10 Jan 2018 02:52:08 +0530 Subject: [PATCH] CRM-21644, Fixed set default for Preferred Communication Method ---------------------------------------- * CRM-21644: Preferred Communication Method is not set to default for contact https://issues.civicrm.org/jira/browse/CRM-21644 --- CRM/Core/BAO/UFGroup.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 493ec603ec..c2bc2bef46 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -2339,7 +2339,10 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) $defaults[$name . '_custom'] = $details[$name . '_custom']; } elseif ($name == 'preferred_communication_method') { - $v = explode(CRM_Core_DAO::VALUE_SEPARATOR, $details[$name]); + $v = $details[$name]; + if (!is_array($details[$name])) { + $v = explode(CRM_Core_DAO::VALUE_SEPARATOR, $v); + } foreach ($v as $item) { if ($item) { $defaults[$fldName . "[$item]"] = 1; -- 2.25.1