Skip to content

Commit

Permalink
Merge pull request #18946 from eileenmcnaughton/if
Browse files Browse the repository at this point in the history
Remove always true if
  • Loading branch information
mattwire authored Nov 9, 2020
2 parents 4eef08f + 8da8c1d commit b3f9bca
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -2623,18 +2623,16 @@ protected static function repeatTransaction(&$contribution, $input, $contributio
$contribution->total_amount = $contributionParams['total_amount'] = $input['amount'];
}

if (!empty($contributionParams['contribution_recur_id'])) {
$recurringContribution = civicrm_api3('ContributionRecur', 'getsingle', [
'id' => $contributionParams['contribution_recur_id'],
]);
if (!empty($recurringContribution['campaign_id'])) {
// CRM-17718 the campaign id on the contribution recur record should get precedence.
$contributionParams['campaign_id'] = $recurringContribution['campaign_id'];
}
if (!empty($recurringContribution['financial_type_id'])) {
// CRM-17718 the campaign id on the contribution recur record should get precedence.
$contributionParams['financial_type_id'] = $recurringContribution['financial_type_id'];
}
$recurringContribution = civicrm_api3('ContributionRecur', 'getsingle', [
'id' => $contributionParams['contribution_recur_id'],
]);
if (!empty($recurringContribution['campaign_id'])) {
// CRM-17718 the campaign id on the contribution recur record should get precedence.
$contributionParams['campaign_id'] = $recurringContribution['campaign_id'];
}
if (!empty($recurringContribution['financial_type_id'])) {
// CRM-17718 the campaign id on the contribution recur record should get precedence.
$contributionParams['financial_type_id'] = $recurringContribution['financial_type_id'];
}
$templateContribution = CRM_Contribute_BAO_ContributionRecur::getTemplateContribution(
$contributionParams['contribution_recur_id'],
Expand Down

0 comments on commit b3f9bca

Please sign in to comment.