Commit 63d18d06 authored by Monish Deb's avatar Monish Deb Committed by GitHub

Merge pull request #10575 from JMAConsulting/CRM-20747-rc

CRM-20747: {contribution.campaign} token not working on Contribution
parents fabb91b0 2b0c1e33
......@@ -246,10 +246,8 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF
public static function buildContributionArray($groupBy, $contributionIDs, $returnProperties, $skipOnHold, $skipDeceased, $messageToken, $task, $separator, $isIncludeSoftCredits) {
$contributions = $contacts = $notSent = array();
foreach ($contributionIDs as $item => $contributionId) {
// get contribution information
// basic return attributes needed, see below for there usage
$returnValues = array('contact_id', 'total_amount');
$returnValues = array('contact_id', 'total_amount', 'contribution_campaign_title');
if (!empty($messageToken['contribution'])) {
$returnValues = array_merge($messageToken['contribution'], $returnValues);
}
......@@ -258,6 +256,7 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF
'id' => $contributionId,
'return' => $returnValues,
));
$contribution['campaign'] = CRM_Utils_Array::value('contribution_campaign_title', $contribution);
$contributions[$contributionId] = $contribution;
if ($isIncludeSoftCredits) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment