X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FMember%2FForm%2FMembership.php;h=5767b89d9d02923078b41e85bf4d22bb737e42bd;hb=fcf467dc52263a0b12ed4faa883a1a4c30a4ce75;hp=f58e7dd9dff2348d4e266b069f0dccbb2337cc2b;hpb=be9d3523a20e916cf701dc139c74dc4a89a8e5df;p=civicrm-core.git diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index f58e7dd9df..5767b89d9d 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -1157,11 +1157,6 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { $allMemberStatus = CRM_Member_PseudoConstant::membershipStatus(); $allContributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(); - $lineItems = NULL; - if (!empty($this->_lineItem)) { - $lineItems = $this->_lineItem; - } - if ($this->_id) { $ids['membership'] = $params['id'] = $this->_id; } @@ -1493,15 +1488,23 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { $financialType = new CRM_Financial_DAO_FinancialType(); $financialType->id = $params['financial_type_id']; $financialType->find(TRUE); + $contribution = CRM_Contribute_Form_Contribution_Confirm::processFormContribution($this, $paymentParams, - $result, - $this->_contributorContactID, + NULL, + array( + 'contact_id' => $this->_contributorContactID, + 'line_item' => $lineItem, + 'is_test' => $isTest, + 'campaign_id' => CRM_Utils_Array::value('campaign_id', $paymentParams), + 'contribution_page_id' => CRM_Utils_Array::value('contribution_page_id', $this->_params), + 'source' => CRM_Utils_Array::value('source', $paymentParams, CRM_Utils_Array::value('description', $paymentParams)), + 'thankyou_date' => CRM_Utils_Array::value('thankyou_date', $paymentParams), + 'payment_instrument_id' => $this->_paymentProcessor['payment_instrument_id'], + ), $financialType, TRUE, FALSE, - $isTest, - $lineItems, $this->_bltID ); @@ -1611,6 +1614,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { // process - // @see http://wiki.civicrm.org/confluence/pages/viewpage.action?pageId=261062657#Payments&AccountsRoadmap-Movetowardsalwaysusinga2-steppaymentprocess $membershipParams['contribution_status_id'] = CRM_Utils_Array::value('payment_status_id', $result); + unset($membershipParams['lineItems']); $membership = CRM_Member_BAO_Membership::create($membershipParams, $ids); $params['contribution'] = CRM_Utils_Array::value('contribution', $membershipParams); unset($params['lineItems']); @@ -1793,7 +1797,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { CRM_Core_Session::setStatus($statusMsg, ts('Complete'), 'success'); //CRM-15187 // dusplay message when membership type is changed - if ($this->_id && !in_array($this->_memType, $this->_memTypeSelected)) { + if (($this->_action & CRM_Core_Action::UPDATE) && $this->_id && !in_array($this->_memType, $this->_memTypeSelected)) { CRM_Core_Session::setStatus( ts('The financial types associated with the old and new membership types are different. You may want to edit the contribution associated with this membership to adjust its financial type.'), ts('Warning')