From 313fc1e4e47538958e5d0d7ac2163b2a994593eb Mon Sep 17 00:00:00 2001 From: Edsel Date: Mon, 8 Feb 2016 20:09:28 +0530 Subject: [PATCH] CRM-16526 CIVI-3 Temporary fix to prevent rollback when no permission for line item ---------------------------------------- * CRM-16526: ACLs for Financial Types https://issues.civicrm.org/jira/browse/CRM-16526 --- api/v3/LineItem.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/v3/LineItem.php b/api/v3/LineItem.php index a31a5524ba..4badcf3ae9 100644 --- a/api/v3/LineItem.php +++ b/api/v3/LineItem.php @@ -58,12 +58,12 @@ function civicrm_api3_line_item_create($params) { $op = CRM_Core_Action::UPDATE; } CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($types, $op); - if (!in_array($params['financial_type_id'], array_keys($types))) { - return civicrm_api3_create_error('You do not have permission to create this line item'); - } } - $params = CRM_Contribute_BAO_Contribution::checkTaxAmount($params, TRUE); - return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); + if (in_array($params['financial_type_id'], array_keys($types))) { + $params = CRM_Contribute_BAO_Contribution::checkTaxAmount($params, TRUE); + return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); + } + return civicrm_api3_create_success(array()); } /** -- 2.25.1