From 75f2128936da97cb4f8ef88dc8e6770bf802a619 Mon Sep 17 00:00:00 2001 From: Andrew West Date: Fri, 14 Feb 2020 14:36:59 +0000 Subject: [PATCH] #991 subtypes not filled in when editing a smart group https://lab.civicrm.org/dev/core/issues/991 --- CRM/Contact/Form/Search/Advanced.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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; } -- 2.25.1