dev/core#530 CiviCase: don't assume that clients or case role contacts are individuals
authorAlice Frumin <alice@aghstrategies.com>
Fri, 3 May 2019 15:31:54 +0000 (11:31 -0400)
committerAlice Frumin <alice@aghtrategies.com>
Mon, 10 Jun 2019 15:26:09 +0000 (11:26 -0400)
CRM/Case/ManagedEntities.php

index d3d33a027866747e98c6266b4318e63edb4c3e90..15bc97354f7e0448489900456c68aac7f9966ac9 100644 (file)
@@ -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,
         ],