From 4ec7a83af28cd1063126e89bafaf07c4512eacbe Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 21 Jun 2021 09:16:08 +1200 Subject: [PATCH] Deprecate guess work in processPriceSet Testing to see how much of this we can deprecate - line items should be 'complete' before reaching the processing function --- CRM/Price/BAO/LineItem.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index f4271716aa19..991b093a9cb7 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -391,6 +391,9 @@ public static function processPriceSet($entityId, $lineItems, $contributionDetai $line['entity_id'] = $entityId; } if (!empty($line['membership_type_id'])) { + if (($line['entity_table'] ?? '') !== 'civicrm_membership') { + CRM_Core_Error::deprecatedWarning('entity table should be already set'); + } $line['entity_table'] = 'civicrm_membership'; } if (!empty($contributionDetails->id)) {