From 243320eda23195985815ceb65ec7ee9079ae3014 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 2 Apr 2020 12:01:00 +1300 Subject: [PATCH] Remove deprecated cleaning of money in the BAO layer Any code that passed dirty money to the Contribution::create BAO will have been seeing deprecation notices for some time. The supported method is via the api & v3 api does the cleaning whereas v4 expects it to be pre-cleaned - perhaps it's time to remove this & leave it to the calling code --- CRM/Contribute/BAO/Contribution.php | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 0ff447a0c3..e98ee415c0 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -103,30 +103,6 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { throw new CRM_Core_Exception($message); } - // first clean up all the money fields - $moneyFields = [ - 'total_amount', - 'net_amount', - 'fee_amount', - 'non_deductible_amount', - ]; - - //if priceset is used, no need to cleanup money - if (!empty($params['skipCleanMoney'])) { - $moneyFields = []; - } - else { - // @todo put a deprecated here - this should be done in the form layer. - $params['skipCleanMoney'] = FALSE; - Civi::log()->warning('Deprecated code path. Money should always be clean before it hits the BAO.', array('civi.tag' => 'deprecated')); - } - - foreach ($moneyFields as $field) { - if (isset($params[$field])) { - $params[$field] = CRM_Utils_Rule::cleanMoney($params[$field]); - } - } - //set defaults in create mode if (!$contributionID) { CRM_Core_DAO::setCreateDefaults($params, self::getDefaults()); -- 2.25.1