From 50e2d48d9ea64dc27e0ee1c0163779bc5f2d4f37 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Wed, 6 Sep 2017 15:46:22 +0530 Subject: [PATCH] additional fix --- CRM/Core/Page/AJAX.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/CRM/Core/Page/AJAX.php b/CRM/Core/Page/AJAX.php index 63ba1a129e..2035feafa4 100644 --- a/CRM/Core/Page/AJAX.php +++ b/CRM/Core/Page/AJAX.php @@ -108,22 +108,19 @@ class CRM_Core_Page_AJAX { } $priceSetId = CRM_Price_BAO_PriceSet::getFor($context, $id, NULL); if ($priceSetId) { - $result = CRM_Price_BAO_PriceSet::setIsQuickConfig($priceSetId, 0); + $sql = "UPDATE + civicrm_price_set cps + INNER JOIN civicrm_price_set_entity cpse ON cps.id = cpse.price_set_id + INNER JOIN {$context} ce ON cpse.entity_id = ce.id AND ce.id = %1 + 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) + "; + CRM_Core_DAO::executeQuery($sql, array(1 => array($id, 'Integer'))); + if ($context == 'civicrm_event') { - $sql = "UPDATE - civicrm_price_set cps - INNER JOIN civicrm_discount cd ON cd.price_set_id = cps.id - 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); } } - if (!$result) { - $priceSetId = NULL; - } + CRM_Utils_JSON::output($priceSetId); } -- 2.25.1