Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Remove unreachable code #21294

Merged
merged 1 commit into from
Aug 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -2076,9 +2076,6 @@ public static function transitionComponents($params) {
// @todo fix the one place that calls this function to use Payment.create
// remove this.
// get minimum required values.
$contactId = NULL;
$componentId = NULL;
$componentName = NULL;
$contributionId = $params['contribution_id'];
$contributionStatusId = $params['contribution_status_id'];

Expand All @@ -2087,21 +2084,8 @@ public static function transitionComponents($params) {
return;
}

if (!$componentName || !$componentId) {
// get the related component details.
$componentDetails = self::getComponentDetails($contributionId);
}
else {
$componentDetails['contact_id'] = $contactId;
$componentDetails['component'] = $componentName;

if ($componentName === 'event') {
$componentDetails['participant'] = $componentId;
}
else {
$componentDetails['membership'] = $componentId;
}
}
// get the related component details.
$componentDetails = self::getComponentDetails($contributionId);

if (!empty($componentDetails['contact_id'])) {
$componentDetails['contact_id'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution',
Expand Down