From: Andrew West Date: Fri, 14 Feb 2020 14:36:59 +0000 (+0000) Subject: #991 subtypes not filled in when editing a smart group X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=75f2128936da97cb4f8ef88dc8e6770bf802a619;p=civicrm-core.git #991 subtypes not filled in when editing a smart group https://lab.civicrm.org/dev/core/issues/991 --- diff --git a/CRM/Contact/Form/Search/Advanced.php b/CRM/Contact/Form/Search/Advanced.php index 6a4127b25a..e25c48fcd4 100644 --- a/CRM/Contact/Form/Search/Advanced.php +++ b/CRM/Contact/Form/Search/Advanced.php @@ -191,6 +191,14 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { ], $defaults); $this->normalizeDefaultValues($defaults); + //991/Subtypes not respected when editing smart group criteria + if ($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; }