[REF] Remove unreachable code
authorEileen McNaughton <emcnaughton@wikimedia.org>
Sat, 28 Aug 2021 02:58:22 +0000 (14:58 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Sat, 28 Aug 2021 02:58:22 +0000 (14:58 +1200)
CRM/Contribute/BAO/Contribution.php

index a37052102b93ad885bbe9e83bd642cd632b43f31..f07c72d3da19ac017755547f34297107ec6abaa7 100644 (file)
@@ -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',