Skip to content

Commit

Permalink
Notice fix
Browse files Browse the repository at this point in the history
  • Loading branch information
monishdeb committed Jul 23, 2020
1 parent 15589e3 commit a78e9b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CRM/Contact/BAO/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public static function &create(&$params, $fixAddress = TRUE, $invokeHooks = TRUE
}
}

if (array_key_exists('group', $params)) {
if (!empty($params['group'])) {
$contactIds = [$params['contact_id']];
foreach ($params['group'] as $groupId => $flag) {
if ($flag == 1) {
Expand Down
10 changes: 5 additions & 5 deletions CRM/Contact/Form/Edit/TagsAndGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ public static function setDefaults($id, &$defaults, $type = self::ALL, $fieldNam

$contactGroup = CRM_Contact_BAO_GroupContact::getContactGroup($id, 'Added', NULL, FALSE, TRUE);
if ($contactGroup) {
foreach ($contactGroup as $group) {
if ($groupElementType == 'select') {
$defaults[$fName][] = $group['group_id'];
}
else {
if ($groupElementType == 'select') {
$defaults[$fName] = implode(',', CRM_Utils_Array::collect('group_id', $contactGroup));
}
else {
foreach ($contactGroup as $group) {
$defaults[$fName . '[' . $group['group_id'] . ']'] = 1;
}
}
Expand Down

0 comments on commit a78e9b2

Please sign in to comment.