Remove 1 or 2 remaining places where relatedObjects is called in completeOrder
authoreileen <emcnaughton@wikimedia.org>
Tue, 25 Aug 2020 20:00:01 +0000 (08:00 +1200)
committereileen <emcnaughton@wikimedia.org>
Wed, 26 Aug 2020 19:04:06 +0000 (07:04 +1200)
If we remove this & the other place we no longer need to call loadRelatedObjects before this
function and only message related places call it

In this case the lines can go as

1) trxn_id should always be used if provided. Casting to isoDate has not been required for a few
years as the DAO now handles

CRM/Contribute/BAO/Contribution.php

index a74d99bc5736d3c6d0dd9505a631a08069f71cd1..989090a8acb9cfca0b71fc9516f430240e4fab79 100644 (file)
@@ -4545,12 +4545,6 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac
       CRM_Contribute_BAO_ContributionRecur::addrecurSoftCredit($objects['contributionRecur']->id, $contribution->id);
     }
 
-    if (empty($contribution->_relatedObjects['participant']) && !empty($contribution->_relatedObjects['membership'])) {
-      // @fixme Can we remove this if altogether? - we removed the participant if / else and left relatedObjects['participant'] to ensure behaviour didn't change but it is probably not required.
-      // @todo - use getRelatedMemberships instead
-      $contribution->trxn_id = $input['trxn_id'] ?? NULL;
-      $contribution->receive_date = CRM_Utils_Date::isoToMysql($contribution->receive_date);
-    }
     $contribution->contribution_status_id = $contributionParams['contribution_status_id'];
 
     CRM_Core_Error::debug_log_message('Contribution record updated successfully');