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>
Thu, 10 Mar 2016 13:53:38 +0000 (19:23 +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 9e10d2f7a8e8e8bab6cd4ca4fa6b8c9d03300d75..11b5189ed50345e63a4356c30b07931bd6a85747 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);
     }