From 2889ef0785d5783474b26ce20ffd855aba2b77a0 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Wed, 6 Sep 2017 00:58:30 +0530 Subject: [PATCH] CRM-21133: Price set error with NULL financial types --- CRM/Core/Page/AJAX.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Page/AJAX.php b/CRM/Core/Page/AJAX.php index 357b54466e..63ba1a129e 100644 --- a/CRM/Core/Page/AJAX.php +++ b/CRM/Core/Page/AJAX.php @@ -113,8 +113,9 @@ class CRM_Core_Page_AJAX { $sql = "UPDATE civicrm_price_set cps INNER JOIN civicrm_discount cd ON cd.price_set_id = cps.id - SET cps.is_quick_config = 0 - WHERE cd.entity_id = (%1) AND cd.entity_table = 'civicrm_event' "; + INNER JOIN civicrm_event ce ON cd.entity_id = ce.id AND cd.entity_table = 'civicrm_event' + SET cps.is_quick_config = 0, cps.financial_type_id = IF(cps.financial_type_id IS NULL, ce.financial_type_id, cps.financial_type_id) + WHERE cd.entity_id = (%1) "; $params = array(1 => array($id, 'Integer')); CRM_Core_DAO::executeQuery($sql, $params); CRM_Core_BAO_Discount::del($id, $context); -- 2.25.1