Deprecate guess work in processPriceSet
authorEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 20 Jun 2021 21:16:08 +0000 (09:16 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 13 Jul 2021 03:36:42 +0000 (15:36 +1200)
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

index c2c707f7b0c46e6d9ce0cd51a98d54fdcbfd17c8..618765423840dc42a909fd4183371dc08e418f27 100644 (file)
@@ -400,6 +400,9 @@ WHERE li.contribution_id = %1";
           $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)) {