dev/core#1853 - Fix validation errors when removing contact subtype
authorColeman Watts <coleman@civicrm.org>
Mon, 6 Jul 2020 18:56:02 +0000 (14:56 -0400)
committerColeman Watts <coleman@civicrm.org>
Mon, 6 Jul 2020 18:56:02 +0000 (14:56 -0400)
CRM/Contact/Form/Contact.php

index 3a1d69fc168bad9c9df1c793617f99318db8c4d2..20d115f28dc13cf80f63db8ee3e9ad4cc337b40c 100644 (file)
@@ -367,8 +367,8 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
       else {
         $contactSubType = $this->_contactSubType;
         // need contact sub type to build related grouptree array during post process
-        if (!empty($_POST['contact_sub_type'])) {
-          $contactSubType = $_POST['contact_sub_type'];
+        if (!empty($_POST['qfKey'])) {
+          $contactSubType = $_POST['contact_sub_type'] ?? NULL;
         }
         //only custom data has preprocess hence directly call it
         CRM_Custom_Form_CustomData::preProcess($this, NULL, $contactSubType,