Merge pull request #15270 from civicrm/5.18
[civicrm-core.git] / CRM / Member / BAO / MembershipPayment.php
index bacf50d2f770b2854992fa80ad33df21c8b5ecc0..080fab308b91d6b1bcea10b5847c34205fa96f96 100644 (file)
@@ -34,7 +34,6 @@
  */
 class CRM_Member_BAO_MembershipPayment extends CRM_Member_DAO_MembershipPayment {
 
-
   /**
    * Class constructor.
    */
@@ -73,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,