From d1bd4bec263abc71ff4f86b91e6952f385ede97a Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 6 Jul 2020 14:56:02 -0400 Subject: [PATCH] dev/core#1853 - Fix validation errors when removing contact subtype --- CRM/Contact/Form/Contact.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 3a1d69fc16..20d115f28d 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -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, -- 2.25.1