restore custom fields for contact subtypes on create
authorJon Goldberg <jon@megaphonetech.com>
Sat, 13 Jan 2024 20:11:44 +0000 (15:11 -0500)
committerJon Goldberg <jon@megaphonetech.com>
Mon, 15 Jan 2024 17:05:53 +0000 (12:05 -0500)
CRM/Contact/Form/Contact.php

index d9059f9391cdd658c0b2dc6371b20fb3d56c0ec2..8c9106715c11c44e304c5ffabd80f2080c086c90 100644 (file)
@@ -364,7 +364,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
         // the buildForm adds the contact_sub_type to the form we need to look in _submitValues for it - submitValues
         // is a un-sanitised version of what is in the form submission (_POST) whereas `getSubmittedValues()` retrieves
         // 'allowed' POSTED values - ie values which match available fields, with some localization handling.
-        CRM_Custom_Form_CustomData::preProcess($this, NULL, $this->isSubmitted() ? ($this->_submitValues['contact_sub_type'] ?? []) : $this->getContactValue('contact_sub_type'),
+        CRM_Custom_Form_CustomData::preProcess($this, NULL, $this->isSubmitted() ? ($this->_submitValues['contact_sub_type'] ?? []) : $this->getContactValue('contact_sub_type') ?? $this->_contactSubType,
           1, $this->_contactType, $this->getContactID()
         );
         $this->assign('customValueCount', $this->_customValueCount);