CRM-12869 This is a temporary fix from Eileen which prevents the over-write. However...
authorDave Greenberg <dave@civicrm.org>
Thu, 8 Aug 2013 23:31:58 +0000 (16:31 -0700)
committerDave Greenberg <dave@civicrm.org>
Thu, 8 Aug 2013 23:31:58 +0000 (16:31 -0700)
----------------------------------------
* CRM-12869: Record Payment from different contact causes email and address to be altered in contacts record
  http://issues.civicrm.org/jira/browse/CRM-12869

CRM/Member/Form/Membership.php

index a992a00935f97bbf09d89333bf9645a17898b926..f484feb5377f1357a0d0dc89a4941da2a6d19fe1 100644 (file)
@@ -1357,12 +1357,12 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
           $formValues['preserveDBName'] = TRUE;
         }
       }
-      //here we are setting up the billing contact - if different from the member they are already created
-      // but they will get billing details assigned
-      CRM_Contact_BAO_Contact::createProfileContact($formValues, $fields,
-        $this->_contributorContactID, NULL, NULL, $ctype
-      );
-
+      if ($this->_contributorContactID == $this->_contactID) {
+        //see CRM-12869 for discussion of why we don't do this for separate payee payments
+        CRM_Contact_BAO_Contact::createProfileContact($formValues, $fields,
+          $this->_contributorContactID, NULL, NULL, $ctype
+        );
+      }
 
       // add all the additioanl payment params we need
       $this->_params["state_province-{$this->_bltID}"] = $this->_params["billing_state_province-{$this->_bltID}"] = CRM_Core_PseudoConstant::stateProvinceAbbreviation($this->_params["billing_state_province_id-{$this->_bltID}"]);