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) {