Remove always-true & otherwise silly if
authoreileen <emcnaughton@wikimedia.org>
Fri, 30 Oct 2020 07:23:47 +0000 (20:23 +1300)
committereileen <emcnaughton@wikimedia.org>
Fri, 30 Oct 2020 07:24:24 +0000 (20:24 +1300)
CRM/Core/Payment/PayPalProIPN.php

index 9901c3ea8f7bd679dd2064e6515ae8b2fe325950..5f48eb3d481bbe7b46977f68e92250d1ae7f3453 100644 (file)
@@ -440,21 +440,17 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr
 
       $input['payment_processor_id'] = $paymentProcessorID;
 
-      //?? how on earth would we not have component be one of these?
-      // they are the only valid settings & this IPN file can't even be called without one of them
-      // grepping for this class doesn't find other paths to call this class
-      if ($this->_component == 'contribute' || $this->_component == 'event') {
-        if ($ids['contributionRecur']) {
-          // check if first contribution is completed, else complete first contribution
-          $first = TRUE;
-          $completedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed');
-          if ($objects['contribution']->contribution_status_id == $completedStatusId) {
-            $first = FALSE;
-          }
-          $this->recur($input, $ids, $objects, $first);
-          return;
+      if ($ids['contributionRecur']) {
+        // check if first contribution is completed, else complete first contribution
+        $first = TRUE;
+        $completedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed');
+        if ($objects['contribution']->contribution_status_id == $completedStatusId) {
+          $first = FALSE;
         }
+        $this->recur($input, $ids, $objects, $first);
+        return;
       }
+
       $this->single($input, [
         'related_contact' => $ids['related_contact'] ?? NULL,
         'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL,