CRM-14866 membership payment not creating for membership block type
[civicrm-core.git] / CRM / Member / Form.php
index 81c983504066f89fa409755aced11bea530d472d..749bb46ebcc40cd7aa9cf941254259769b0024f4 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -64,7 +64,7 @@ class CRM_Member_Form extends CRM_Core_Form {
    *
    * @access public
    *
-   * @return void
+   * @return array defaults
    */
   function setDefaultValues() {
     $defaults = array();
@@ -168,13 +168,16 @@ class CRM_Member_Form extends CRM_Core_Form {
    * then they weill differ
    *
    * @param $formValues array values from form. The important values we are looking for are
-   *  - contact_select_id[1]
-   *  - contribution_contact_select_id[1]
+   *  - contact_id
+   *  - soft_credit_contact_id
+   */
+  /**
+   * @param $formValues
    */
   function storeContactFields($formValues){
     // in a 'standalone form' (contact id not in the url) the contact will be in the form values
-    if (!empty($formValues['contact_select_id'])) {
-      $this->_contactID = $formValues['contact_select_id'][1];
+    if (!empty($formValues['contact_id'])) {
+      $this->_contactID = $formValues['contact_id'];
     }
 
     list($this->_memberDisplayName,
@@ -183,8 +186,8 @@ class CRM_Member_Form extends CRM_Core_Form {
 
     //CRM-10375 Where the payer differs to the member the payer should get the email.
     // here we store details in order to do that
-    if (!empty($formValues['contribution_contact_select_id']) && !empty($formValues['contribution_contact_select_id']['1'])) {
-      $this->_receiptContactId = $this->_contributorContactID = $formValues['contribution_contact_select_id'][1];
+    if (!empty($formValues['soft_credit_contact_id'])) {
+      $this->_receiptContactId = $this->_contributorContactID = $formValues['soft_credit_contact_id'];
        list( $this->_contributorDisplayName,
          $this->_contributorEmail ) = CRM_Contact_BAO_Contact_Location::getEmailDetails( $this->_contributorContactID );
     }