From 079b7131f50ff4c2189c16357c8b1f85031ca6e3 Mon Sep 17 00:00:00 2001 From: Eli Lisseck Date: Thu, 1 Jun 2017 16:30:32 -0400 Subject: [PATCH] CRM-20672 - CRM/Core/BAO/Mapping - Fix ability to choose related fields for relationship if target contact type not set --- CRM/Core/BAO/Mapping.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CRM/Core/BAO/Mapping.php b/CRM/Core/BAO/Mapping.php index 61827bcba9..403a08535c 100644 --- a/CRM/Core/BAO/Mapping.php +++ b/CRM/Core/BAO/Mapping.php @@ -602,6 +602,13 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { 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); -- 2.25.1