Fix membership/issues#16 Duplicate lineitems when creating a recurring membership...
authorMatthew Wire (MJW Consulting) <mjw@mjwconsult.co.uk>
Thu, 19 Sep 2019 23:36:06 +0000 (00:36 +0100)
committerMatthew Wire (MJW Consulting) <mjw@mjwconsult.co.uk>
Fri, 20 Sep 2019 13:02:12 +0000 (14:02 +0100)
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) {