From e003e69bbe8f6b8d0b81ff21cd3d1514e0ae30f4 Mon Sep 17 00:00:00 2001 From: Michael Devery Date: Wed, 21 Mar 2018 16:31:08 +0000 Subject: [PATCH] CRM-21849: Cast contact_id_a before comparison This property will be a string, but it is being compared to $contactID which should be an int. --- 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 bc6ea7ae57..2b4cd47e7c 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 = ($relationship->contact_id_a === $contactId) ? $relationship->contact_id_b : $relationship->contact_id_a; + $contact->id = ((int) $relationship->contact_id_a === $contactId) ? $relationship->contact_id_b : $relationship->contact_id_a; if ($contact->find(TRUE)) { $otherContactType = $contact->contact_type; -- 2.25.1