Merge pull request #6450 from civicrm/4.6
[civicrm-core.git] / CRM / Core / BAO / Mapping.php
index 17a69245361b8aaada1ae84ecee0cbfd9d55007a..905eae544e130830dea4bf0a472ac542013aee58 100644 (file)
@@ -319,7 +319,13 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
 
     $contactType = array('Individual', 'Household', 'Organization');
     foreach ($contactType as $value) {
-      $contactFields = CRM_Contact_BAO_Contact::exportableFields($value, FALSE, $required);
+      if ($mappingType == 'Search Builder') {
+        // get multiple custom group fields in this context
+        $contactFields = CRM_Contact_BAO_Contact::exportableFields($value, FALSE, $required, FALSE, TRUE);
+      }
+      else {
+        $contactFields = CRM_Contact_BAO_Contact::exportableFields($value, FALSE, $required);
+      }
       $contactFields = array_merge($contactFields, CRM_Contact_BAO_Query_Hook::singleton()->getFields());
 
       // exclude the address options disabled in the Address Settings
@@ -557,7 +563,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
 
     foreach ($sel1 as $key => $sel) {
       if ($key) {
-        // sort everything BUT the contactType which is sorted seperately by
+        // sort everything BUT the contactType which is sorted separately by
         // an initial commit of CRM-13278 (check ksort above)
         if (!in_array($key, $contactType)) {
           asort($mapperFields[$key]);