Co-authored-by: colemanw <coleman@civicrm.org>
// CRM-7925
throw new CRM_Core_Exception(ts('The Contact Sub Type does not match the Contact type for this record'));
}
- // Cast to array as serialization in CRM_Core_DAO::copyValues() will happen only if it is an array.
- $params['contact_sub_type'] = (array) ($params['contact_sub_type']);
+ // Ensure value is an array so it can be handled properly by `copyValues()`
+ if (is_string($params['contact_sub_type'])) {
+ $params['contact_sub_type'] = CRM_Core_DAO::unSerializeField($params['contact_sub_type'], self::fields()['contact_sub_type']['serialize']);
+ }
}
}