CRM-15480 Fix for Recording completed payment for Pending membership from Edit Member...
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 21 Oct 2014 12:53:37 +0000 (18:23 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 21 Oct 2014 12:53:37 +0000 (18:23 +0530)
CRM/Member/Form/Membership.php

index 0a7896d7ea21eaeb5a1d1d3efd068d7ea3638fe9..51b7d5e3bac6d2b83376e4fe2c28598fe4dfea71 100644 (file)
@@ -1549,7 +1549,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
         $result = CRM_Contribute_BAO_Contribution::transitionComponents($params, TRUE);
         if (!empty($result) && !empty($params['contribution_id'])) {
           $lineItem = array();
-          $lineItems = CRM_Price_BAO_LineItem::getLineItems($params['contribution_id'], 'contribution');
+          $lineItems = CRM_Price_BAO_LineItem::getLineItems($params['contribution_id'], 'contribution', NULL, TRUE, TRUE);
           $itemId = key($lineItems);
           $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $lineItems[$itemId]['price_field_id'], 'price_set_id');
           $fieldType = NULL;
@@ -1562,6 +1562,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
           $lineItem[$priceSetId] = $lineItems;
           $contributionBAO = new CRM_Contribute_BAO_Contribution();
           $contributionBAO->id = $params['contribution_id'];
+          $contributionBAO->contact_id = $params['contact_id'];
           $contributionBAO->find();
           CRM_Price_BAO_LineItem::processPriceSet($params['contribution_id'], $lineItem, $contributionBAO, 'civicrm_membership');