Merge pull request #15270 from civicrm/5.18
[civicrm-core.git] / CRM / Member / BAO / MembershipPayment.php
index 7a509ec3e26d77de3d31a264368fbea1a50e351b..080fab308b91d6b1bcea10b5847c34205fa96f96 100644 (file)
@@ -72,6 +72,10 @@ class CRM_Member_BAO_MembershipPayment extends CRM_Member_DAO_MembershipPayment
     // table. However, at this stage we have both - there is still quite a bit of refactoring to do to set the line_iten entity_id right the first time
     // however, we can assume at this stage that any contribution id will have only one line item with that membership type in the line item table
     // OR the caller will have taken responsibility for updating the line items themselves so we will update using SQL here
+    if (!empty($params['isSkipLineItem'])) {
+      // Caller has taken responsibility for updating the line items.
+      return $dao;
+    }
     if (!isset($params['membership_type_id'])) {
       $membership_type_id = civicrm_api3('membership', 'getvalue', [
         'id' => $dao->membership_id,