CRM-12869 ensure giftors email is not over-written on behalf membership
authoreileen <eileen@fuzion.co.nz>
Tue, 6 Aug 2013 21:18:39 +0000 (09:18 +1200)
committereileen <eileen@fuzion.co.nz>
Tue, 6 Aug 2013 21:18:39 +0000 (09:18 +1200)
CRM/Member/Form/Membership.php

index e768561bd177d1ce671b22a430ebf679b32dc7fe..b8434f4d4c68123c0d02eb6f29c46ac91d0ebf18 100644 (file)
@@ -1346,8 +1346,10 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
       $formValues["address_name-{$this->_bltID}"] = trim($formValues["address_name-{$this->_bltID}"]);
 
       $fields["address_name-{$this->_bltID}"] = 1;
-
-      $fields["email-{$this->_bltID}"] = 1;
+      //ensure we don't over-write the payer's email with the member's email
+      if($this->_contributorContactID == $this->_contactID) {
+        $fields["email-{$this->_bltID}"] = 1;
+      }
 
       $ctype = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactID, 'contact_type');