From 7dd1e8d707d9faf0c8d702ddfe93da11eced05bf Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Mon, 27 Nov 2023 11:55:56 -0500 Subject: [PATCH] don't warn users about invalid financial types on unused price sets --- CRM/Utils/Check/Component/PriceFields.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CRM/Utils/Check/Component/PriceFields.php b/CRM/Utils/Check/Component/PriceFields.php index b73cc48393..4c05ea74d7 100644 --- a/CRM/Utils/Check/Component/PriceFields.php +++ b/CRM/Utils/Check/Component/PriceFields.php @@ -27,6 +27,17 @@ class CRM_Utils_Check_Component_PriceFields extends CRM_Utils_Check_Component { INNER JOIN civicrm_price_field psf ON psf.price_set_id = ps.id INNER JOIN civicrm_price_field_value pfv ON pfv.price_field_id = psf.id LEFT JOIN civicrm_financial_type cft ON cft.id = pfv.financial_type_id + INNER JOIN civicrm_price_set_entity pse ON entity_table = 'civicrm_contribution_page' AND ps.id = pse.price_set_id + INNER JOIN civicrm_contribution_page cp ON cp.id = pse.entity_id AND cp.is_active = 1 + WHERE cft.id IS NULL OR cft.is_active = 0 + UNION + SELECT DISTINCT ps.title as ps_title, ps.id as ps_id, psf.label as psf_label + FROM civicrm_price_set ps + INNER JOIN civicrm_price_field psf ON psf.price_set_id = ps.id + INNER JOIN civicrm_price_field_value pfv ON pfv.price_field_id = psf.id + LEFT JOIN civicrm_financial_type cft ON cft.id = pfv.financial_type_id + INNER JOIN civicrm_price_set_entity pse ON entity_table = 'civicrm_event' AND ps.id = pse.price_set_id + INNER JOIN civicrm_event ce ON ce.id = pse.entity_id AND ce.is_active = 1 WHERE cft.id IS NULL OR cft.is_active = 0"; $dao = CRM_Core_DAO::executeQuery($sql); $count = 0; -- 2.25.1