From: jitendrapurohit Date: Tue, 21 Oct 2014 12:53:37 +0000 (+0530) Subject: CRM-15480 Fix for Recording completed payment for Pending membership from Edit Member... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7524682eaca98185f0403048c78ef58cbbd5ab54;p=civicrm-core.git CRM-15480 Fix for Recording completed payment for Pending membership from Edit Membership throws fatal error --- diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index 0a7896d7ea..51b7d5e3ba 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -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');