Fix for re-assign a case to another contact
authorSudha Bisht <sudha.bisht@webaccessglobal.com>
Fri, 15 May 2015 06:02:03 +0000 (11:32 +0530)
committerSudha Bisht <sudha.bisht@webaccessglobal.com>
Fri, 15 May 2015 06:02:03 +0000 (11:32 +0530)
CRM/Contact/BAO/Relationship.php

index 73d1a6619f48a2e39813c26f5764cb011e8cf195..47f69f6e66654f26acbc2a53ce5f5ac1ae1b7baa 100644 (file)
@@ -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++;