Use already detemined value for contributionRecurid
authoreileen <emcnaughton@wikimedia.org>
Wed, 26 Aug 2020 22:05:04 +0000 (10:05 +1200)
committereileen <emcnaughton@wikimedia.org>
Wed, 26 Aug 2020 22:14:05 +0000 (10:14 +1200)
CRM/Contribute/BAO/Contribution.php

index d69c94fbac0259a572339ca72796295e9e0ece2a..0e8ba3d61c1a9d224811a6242648d8c9e929c1ba 100644 (file)
@@ -4545,8 +4545,8 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac
     }
 
     // Add new soft credit against current $contribution.
-    if (!empty($objects['contributionRecur']) && $objects['contributionRecur']->id) {
-      CRM_Contribute_BAO_ContributionRecur::addrecurSoftCredit($objects['contributionRecur']->id, $contribution->id);
+    if ($recurringContributionID) {
+      CRM_Contribute_BAO_ContributionRecur::addrecurSoftCredit($recurringContributionID, $contribution->id);
     }
 
     $contribution->contribution_status_id = $contributionParams['contribution_status_id'];