From b277f8d1539fc5736a6627430851b7c426c35e32 Mon Sep 17 00:00:00 2001 From: Michael Devery Date: Tue, 27 Mar 2018 14:43:56 +0100 Subject: [PATCH] CRM-21849: Change to loose comparison Based on the docblock I expected contact ID to be an int, but this is not always the case. --- CRM/Contact/BAO/Relationship.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index 2b4cd47e7c..afad108102 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -539,7 +539,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { $relationship->id = $relationshipId; if ($relationship->find(TRUE)) { $contact = new CRM_Contact_DAO_Contact(); - $contact->id = ((int) $relationship->contact_id_a === $contactId) ? $relationship->contact_id_b : $relationship->contact_id_a; + $contact->id = ($relationship->contact_id_a == $contactId) ? $relationship->contact_id_b : $relationship->contact_id_a; if ($contact->find(TRUE)) { $otherContactType = $contact->contact_type; -- 2.25.1