elseif (isset($relationshipType->$target_type)) {
$relatedFields = array_merge((array) $relatedMapperFields[$relationshipType->$target_type], (array) $relationshipCustomFields);
}
+ //CRM-20672 If contact target type not set e.g. "All Contacts" relationship - present user with all field options and let them determine what they expect to work
+ else {
+ foreach ($contactTypes as $contactType => $label) {
+ $relatedFields = array_merge($relatedFields, (array) $relatedMapperFields[$label]);
+ }
+ $relatedFields = array_merge($relatedFields, (array) $relationshipCustomFields);
+ }
}
$relationshipType->free();
asort($relatedFields);