X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCase%2FInfo.php;h=ce5421fd1b0d754869efd47c00da6e5f7e1844ac;hb=3b7339b8901f6c480c23ac3a28e9fb152fcd1e42;hp=413385c55ddfa9d9a1cae443827c35fcc2c25dc1;hpb=be59734a3b9bede8946b25118ccf65846c169cf0;p=civicrm-core.git diff --git a/CRM/Case/Info.php b/CRM/Case/Info.php index 413385c55d..ce5421fd1b 100644 --- a/CRM/Case/Info.php +++ b/CRM/Case/Info.php @@ -144,8 +144,14 @@ class CRM_Case_Info extends CRM_Core_Component_Info { } elseif ($dao instanceof CRM_Contact_DAO_RelationshipType) { /** @var $dao CRM_Contact_DAO_RelationshipType */ - $count = CRM_Case_XMLRepository::singleton() - ->getRelationshipReferenceCount($dao->{CRM_Case_XMLProcessor::REL_TYPE_CNAME}); + + // Need to look both directions, but no need to translate case role + // direction from XML perspective to client-based perspective + $xmlRepo = CRM_Case_XMLRepository::singleton(); + $count = $xmlRepo->getRelationshipReferenceCount($dao->label_a_b); + if ($dao->label_a_b != $dao->label_b_a) { + $count += $xmlRepo->getRelationshipReferenceCount($dao->label_b_a); + } if ($count > 0) { $result[] = [ 'name' => 'casetypexml:relationships',