From d0878639b0cca008795721ba6541c7e23b0c5925 Mon Sep 17 00:00:00 2001 From: Alice Frumin Date: Fri, 3 May 2019 11:31:54 -0400 Subject: [PATCH] dev/core#530 CiviCase: don't assume that clients or case role contacts are individuals --- CRM/Case/ManagedEntities.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CRM/Case/ManagedEntities.php b/CRM/Case/ManagedEntities.php index d3d33a0278..15bc97354f 100644 --- a/CRM/Case/ManagedEntities.php +++ b/CRM/Case/ManagedEntities.php @@ -123,6 +123,12 @@ class CRM_Case_ManagedEntities { $relTypes = $xmlRepo->getAllDeclaredRelationshipTypes(); foreach ($relTypes as $relType) { + // Making assumption that client is the A side of the relationship. + // Relationship label coming from XML, meaning from perspective of + // non-client. + + // These assumptions only apply if a case type is introduced without the + // relationship types already existing. $managed = [ 'module' => 'civicrm', 'name' => "civicase:rel:$relType", @@ -136,8 +142,8 @@ class CRM_Case_ManagedEntities { 'label_a_b' => "$relType is", 'label_b_a' => $relType, 'description' => $relType, - 'contact_type_a' => 'Individual', - 'contact_type_b' => 'Individual', + 'contact_type_a' => NULL, + 'contact_type_b' => NULL, 'contact_sub_type_a' => NULL, 'contact_sub_type_b' => NULL, ], -- 2.25.1