From 81d1f76434950021d68c84c9630de8c56f70961b Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Fri, 4 Dec 2015 09:28:51 +0100 Subject: [PATCH] Added check if relationship types exist. --- CRM/Contact/BAO/Relationship.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index ba71b147e9..065a88ca3f 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -622,8 +622,9 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { //or between individual and organization if (($action & CRM_Core_Action::DISABLE) || ($action & CRM_Core_Action::DELETE)) { $relTypes = CRM_Utils_Array::index(array('name_a_b'), CRM_Core_PseudoConstant::relationshipType('name')); - if ($relationship->relationship_type_id == $relTypes['Employee of']['id'] || - $relationship->relationship_type_id == $relTypes['Household Member of']['id'] + if ( + (isset($relTypes['Employee of']) && $relationship->relationship_type_id == $relTypes['Employee of']['id']) || + (isset ($relTypes['Household Member of']) && $relationship->relationship_type_id == $relTypes['Household Member of']['id']) ) { $sharedContact = new CRM_Contact_DAO_Contact(); $sharedContact->id = $relationship->contact_id_a; -- 2.25.1