Merge pull request #15335 from jitendrapurohit/13365-test
[civicrm-core.git] / CRM / Member / BAO / Membership.php
index 2e22a1d836380d137e3231697761c5ed157e9cca..bbd24740df693ddc6f4bb57e6afe13896b9b9b5c 100644 (file)
@@ -376,7 +376,7 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership {
 
     // This could happen if there is no contribution or we are in one of many
     // weird and wonderful flows. This is scary code. Keep adding tests.
-    if (!empty($params['line_item']) && empty($ids['contribution'])) {
+    if (!empty($params['line_item']) && empty($ids['contribution']) && empty($params['contribution_id'])) {
 
       foreach ($params['line_item'] as $priceSetId => $lineItems) {
         foreach ($lineItems as $lineIndex => $lineItem) {