CRM-18204, used contact type and contact sub type for checking uf group type
authorPradeep Nayak <pradpnayak@gmail.com>
Thu, 10 Mar 2016 13:45:47 +0000 (19:15 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Fri, 11 Mar 2016 08:11:03 +0000 (13:41 +0530)
----------------------------------------
* CRM-18204: Enables use of Mixed Profile for create mode
  https://issues.civicrm.org/jira/browse/CRM-18204

CRM/UF/Page/Field.php

index c2cec5186e358b8e81fd62277c4f1fbbecc868af..ef76bec53e28025b5010d296d2f0e0b4427071bb 100644 (file)
@@ -126,7 +126,9 @@ class CRM_UF_Page_Field extends CRM_Core_Page {
     $this->assign('isGroupReserved', $isGroupReserved);
 
     $profileType = CRM_Core_BAO_UFField::getProfileType($this->_gid);
-    if ($profileType == 'Contribution' || $profileType == 'Membership' || $profileType == 'Activity' || $profileType == 'Participant') {
+    $contactTypes = CRM_Contact_BAO_ContactType::contactTypes();
+    $contactTypes[] = 'Contact';
+    if (!in_array($profileType, $contactTypes)) {
       $this->assign('skipCreate', TRUE);
     }