From: Eileen McNaughton Date: Sat, 28 Aug 2021 02:58:22 +0000 (+1200) Subject: [REF] Remove unreachable code X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=713b3a2c527b4db462efb83ca02183d3aa354b1b;p=civicrm-core.git [REF] Remove unreachable code --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index a37052102b..f07c72d3da 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2076,9 +2076,6 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ // @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']; @@ -2087,21 +2084,8 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ 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',