From fef6148e1d4ed6b881620dd6b3ea6b30afc308b2 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Tue, 30 Aug 2016 15:27:34 +0530 Subject: [PATCH] CRM-19275 - DB Error on adding priceset when deferred revenue setting is enabled --- CRM/Financial/BAO/FinancialAccount.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CRM/Financial/BAO/FinancialAccount.php b/CRM/Financial/BAO/FinancialAccount.php index bc7994cd83..1c1805efa0 100644 --- a/CRM/Financial/BAO/FinancialAccount.php +++ b/CRM/Financial/BAO/FinancialAccount.php @@ -443,18 +443,16 @@ LIMIT 1"; return FALSE; } if ($entityID) { - $query = ' SELECT ps.extends FROM civicrm_price_set ps %3 WHERE %1.id = %2'; + $query = ' SELECT ps.extends FROM civicrm_price_set ps'; $params = array( 1 => array('ps', 'Text'), 2 => array($entityID, 'Integer'), ); if ($entity == 'PriceField') { $params[1] = array('pf', 'Text'); - $params[3] = array( - ' INNER JOIN civicrm_price_field pf ON pf.price_set_id = ps.id ', - 'Text', - ); + $query .= ' INNER JOIN civicrm_price_field pf ON pf.price_set_id = ps.id '; } + $query .= ' WHERE %1.id = %2'; $extends = CRM_Core_DAO::singleValueQuery($query, $params); $extends = explode('', $extends); if (!(in_array(CRM_Core_Component::getComponentID('CiviEvent'), $extends) -- 2.25.1