From d817ca8d742f03934465f50b00235e80ab2e7f00 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 19 Feb 2019 16:38:41 +1300 Subject: [PATCH] Remove another instance of 'lower' We have removed almost all of these from the code base due to the performance cost combined with the lack of any upside. Just found another --- CRM/Contribute/BAO/Query.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index 0ce9b35864..6b2ff0e93c 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -155,8 +155,6 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query { $quoteValue = "\"$value\""; } - $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower'; - $recurrringFields = CRM_Contribute_BAO_ContributionRecur::getRecurringFields(); unset($recurrringFields['contribution_recur_payment_made']); foreach ($recurrringFields as $dateField => $dateFieldTitle) { @@ -418,14 +416,12 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query { return; case 'contribution_note': - $value = $strtolower(CRM_Core_DAO::escapeString($value)); + $value = CRM_Core_DAO::escapeString($value); if ($wildcard) { $value = "%$value%"; $op = 'LIKE'; } - // LOWER roughly translates to 'hurt my database without deriving any benefit' See CRM-19811. - $wc = ($op != 'LIKE') ? "LOWER(civicrm_note.note)" : "civicrm_note.note"; - $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($wc, $op, $value, "String"); + $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause('civicrm_note.note', $op, $value, "String"); $query->_qill[$grouping][] = ts('Contribution Note %1 %2', array(1 => $op, 2 => $quoteValue)); $query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = $query->_whereTables['contribution_note'] = 1; return; -- 2.25.1