From 2f36ede83b3ab59201fe2985a699898b4966514c Mon Sep 17 00:00:00 2001 From: Sudha Bisht Date: Fri, 15 May 2015 11:32:03 +0530 Subject: [PATCH] Fix for re-assign a case to another contact --- CRM/Contact/BAO/Relationship.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index 73d1a6619f..47f69f6e66 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -230,15 +230,17 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { $validContacts = TRUE; //validate contacts in update mode also. + $contactFields = self::setContactABFromIDs($params, $ids, $ids['contactTarget']); if (!empty($ids['contact']) && !empty($ids['contactTarget'])) { - if (self::checkValidRelationship($params, $ids, $ids['contactTarget'])) { + if (self::checkValidRelationship($contactFields, $ids, $ids['contactTarget'])) { $validContacts = FALSE; $invalid++; } } if ($validContacts) { // editing an existing relationship - $relationship = self::add($params, $ids, $ids['contactTarget']); + $singleInstanceParams = array_merge($params, $contactFields); + $relationship = self::add($singleInstanceParams, $ids, $ids['contactTarget']); $relationshipIds[] = $relationship->id; $relationships[$relationship->id] = $relationship; $saved++; -- 2.25.1