Skip to content

Commit

Permalink
Merge pull request #16541 from bhahumanists/subtype-issue-991
Browse files Browse the repository at this point in the history
#991 subtypes not filled in when editing a smart group
  • Loading branch information
eileenmcnaughton authored May 24, 2020
2 parents 69659ec + d968e78 commit 9a910c3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CRM/Contact/Form/Search/Advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ public function setDefaultValues() {
], $defaults);
$this->normalizeDefaultValues($defaults);

//991/Subtypes not respected when editing smart group criteria
if (!empty($defaults['contact_type']) && !empty($this->_formValues['contact_sub_type'])) {
foreach ($this->_formValues['contact_sub_type'] as $subtype) {
$basicType = CRM_Contact_BAO_ContactType::getBasicType($subtype);
$defaults['contact_type'][$subtype] = $basicType . '__' . $subtype;
}
}

if ($this->_context === 'amtg') {
$defaults['task'] = CRM_Contact_Task::GROUP_ADD;
}
Expand Down

0 comments on commit 9a910c3

Please sign in to comment.