Skip to content

Commit

Permalink
Merge pull request #26914 from eileenmcnaughton/mem_amount
Browse files Browse the repository at this point in the history
Remove old broken code
  • Loading branch information
colemanw authored Jul 24, 2023
2 parents 298cb79 + dc3c6d4 commit 4a6f3a0
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions CRM/Contribute/Form/Contribution/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,32 +182,8 @@ public function setDefaultValues() {
$paymentAmount += $value['scheduled_amount'];
$duePayment = TRUE;
}
elseif ($value['status'] == 'Completed' && $value['contribution_id']) {
$completedContributionIds[] = $value['contribution_id'];
}
}
$this->_defaults['price_' . $this->_priceSetId] = $paymentAmount;

if (count($completedContributionIds)) {
$softCredit = [];
foreach ($completedContributionIds as $id) {
$softCredit = CRM_Contribute_BAO_ContributionSoft::getSoftContribution($id);
}
if (isset($softCredit['soft_credit'])) {
$this->_defaults['soft_credit_type_id'] = $softCredit['soft_credit'][1]['soft_credit_type'];

//since honoree profile fieldname of fields are prefixed with 'honor'
//we need to reformat the fieldname to append prefix during setting default values
CRM_Core_BAO_UFGroup::setProfileDefaults(
$softCredit['soft_credit'][1]['contact_id'],
CRM_Core_BAO_UFGroup::getFields($this->_honoreeProfileId),
$defaults
);
foreach ($defaults as $fieldName => $value) {
$this->_defaults['honor[' . $fieldName . ']'] = $value;
}
}
}
}
elseif (!empty($this->_values['pledge_block_id'])) {
//set default to one time contribution.
Expand Down

0 comments on commit 4a6f3a0

Please sign in to comment.