CRM-16055 remove handling for contact_check from relationship add
authorEileen McNaughton <eileen@fuzion.co.nz>
Mon, 16 Mar 2015 03:53:54 +0000 (16:53 +1300)
committerEileen McNaughton <eileen@fuzion.co.nz>
Mon, 16 Mar 2015 12:35:29 +0000 (01:35 +1300)
CRM/Contact/BAO/Relationship.php

index a7e0bc691ff59b55a639704e183d82f1a73712b1..b0e91f237dea8795a058cfc3e6760644b4cf6616 100644 (file)
@@ -149,15 +149,15 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
     $valid = $invalid = $duplicate = $saved = 0;
     $relationships = $relationshipIds = array();
     $relationshipId = CRM_Utils_Array::value('relationship', $ids, CRM_Utils_Array::value('id', $params));
+    echo 'relationship id is ' . $relationshipId . "\n";
+
     //CRM-9015 - the hooks are called here & in add (since add doesn't call create)
     // but in future should be tidied per ticket
     if (empty($relationshipId)) {
       $hook = 'create';
-      $action = CRM_Core_Action::ADD;
     }
     else {
       $hook = 'edit';
-      $action = CRM_Core_Action::UPDATE;
     }
 
     CRM_Utils_Hook::pre($hook, 'Relationship', $relationshipId, $params);
@@ -269,9 +269,6 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
     //@todo hook are called from create and add - remove one
     CRM_Utils_Hook::pre($hook, 'Relationship', $relationshipId, $params);
 
-    // Requirement to set fields in this function is historical & hopefully can go at some point.
-    $contactFields = self::setContactABFromIDs($params, $ids);
-    $params = array_merge($params, $contactFields);
     $relationshipTypes = CRM_Utils_Array::value('relationship_type_id', $params);
 
     // explode the string with _ to get the relationship type id