Fix undefined index error
authorAndrew West <awest@humanism.org.uk>
Sat, 2 May 2020 12:29:25 +0000 (13:29 +0100)
committerGitHub <noreply@github.com>
Sat, 2 May 2020 12:29:25 +0000 (13:29 +0100)
By checking if contact_type is empty

CRM/Contact/Form/Search/Advanced.php

index c6a76196bd1f1eaa6aced1379cc2f4b2a8c8adc9..4edd6f1c4e1e9a71f890c88340c19a4ba9d0ca1e 100644 (file)
@@ -192,7 +192,7 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search {
     $this->normalizeDefaultValues($defaults);
 
     //991/Subtypes not respected when editing smart group criteria
-    if ($defaults['contact_type'] && !empty($this->_formValues['contact_sub_type'])) {
+    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;