Skip to content

Commit

Permalink
Merge pull request #16043 from agileware/CIVICRM-1391
Browse files Browse the repository at this point in the history
Update Smart Group form unsets the existing Group Types
  • Loading branch information
seamuslee001 authored Dec 8, 2019
2 parents 18c28e0 + 6734751 commit 118e122
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CRM/Contact/Form/Task/SaveSearch/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ public function setDefaultValues() {
$params = ['saved_search_id' => $this->_id];
CRM_Contact_BAO_Group::retrieve($params, $defaults);

if (!empty($defaults['group_type'])) {
$types = explode(CRM_Core_DAO::VALUE_SEPARATOR,
substr($defaults['group_type'], 1, -1)
);
$defaults['group_type'] = array();
foreach ($types as $type) {
$defaults['group_type'][$type] = 1;
}
}
return $defaults;
}

Expand Down

0 comments on commit 118e122

Please sign in to comment.