CRM-21684 contact subtype fields prevent inclusion in profile/receipt email
authorMountev <info@mountev.co.uk>
Fri, 19 Jan 2018 18:37:41 +0000 (18:37 +0000)
committerMountev <info@mountev.co.uk>
Fri, 19 Jan 2018 18:37:41 +0000 (18:37 +0000)
CRM/Core/BAO/UFGroup.php

index 6ff7ded948188df4018ce00d6be3720d7e8034ae..f2e64af8018e34115bf049d7980a9403daef5821 100644 (file)
@@ -1758,6 +1758,11 @@ AND    ( entity_id IS NULL OR entity_id <= 0 )
 
       if (CRM_Contact_BAO_ContactType::isaSubType($profileType)) {
         $profileType = CRM_Contact_BAO_ContactType::getBasicType($profileType);
+
+        //in some cases getBasicType() returns a cached array instead of string. Example: array ('sponsor' => 'organization')
+        if (is_array($profileType)) {
+          $profileType = array_shift($profileType);
+        }
       }
 
       //allow special mix profiles for Contribution and Participant