Skip to content

Commit

Permalink
Revert back
Browse files Browse the repository at this point in the history
  • Loading branch information
lucky091588 committed Dec 9, 2020
1 parent aa72bcb commit c3485f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CRM/Core/BAO/UFGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -1466,13 +1466,15 @@ public static function add(&$params, $ids = []) {
$ufGroup = new CRM_Core_DAO_UFGroup();
$ufGroup->copyValues($params);

if (empty($params['name'])) {
$ufGroupID = CRM_Utils_Array::value('ufgroup', $ids, CRM_Utils_Array::value('id', $params));
if (!$ufGroupID && empty($params['name'])) {
$ufGroup->name = CRM_Utils_String::munge($ufGroup->title, '_', 56);
}
$ufGroup->id = $ufGroupID;

$ufGroup->save();

if (empty($params['name'])) {
if (!$ufGroupID && empty($params['name'])) {
$ufGroup->name = $ufGroup->name . "_{$ufGroup->id}";
$ufGroup->save();
}
Expand Down

0 comments on commit c3485f1

Please sign in to comment.