From: Pradeep Nayak Date: Wed, 20 Jan 2016 10:41:03 +0000 (+0530) Subject: CRM-16259, get particiant id if contribution is related to event X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=af0fda98b23ec71c5cc11221ccac1c73a964737b;p=civicrm-core.git CRM-16259, get particiant id if contribution is related to event ---------------------------------------- * CRM-16259: Create Payment API https://issues.civicrm.org/jira/browse/CRM-16259 --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 432585681b..102bf1fce4 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -3652,6 +3652,9 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac $getInfoOf['id'] = $contributionId; $defaults = array(); $contributionDAO = CRM_Contribute_BAO_Contribution::retrieve($getInfoOf, $defaults, CRM_Core_DAO::$_nullArray); + if (!$participantId) { + $participantId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment', $contributionId, 'participant_id'); + } if ($paymentType == 'owed') { // build params for recording financial trxn entry