From c80e66524cfdc5ac7508fbb6007eb2a83adb13f2 Mon Sep 17 00:00:00 2001 From: "Matthew Wire (MJW Consulting)" Date: Fri, 20 Sep 2019 00:36:06 +0100 Subject: [PATCH] Fix membership/issues#16 Duplicate lineitems when creating a recurring membership via backend --- CRM/Member/BAO/Membership.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 2e22a1d83638..bbd24740df69 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -376,7 +376,7 @@ public static function create(&$params, &$ids = []) { // 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) {