From b7aa36b615d4b1b25f7470d587dae9dead168f4b Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 2 Aug 2018 14:02:06 +1200 Subject: [PATCH] Further removal of instance of using LOWER() rather than relying on mysql non-case-sensitivity. Note I could not find any way to call this so I added deprecation notices Per #12494 the use of LOWER hurts performance fails to return results on some char sets messes with REGEX This is part of a continued (we removed from contribution search fields last year) staggered approach to removing this old mechanism --- CRM/Contact/BAO/Query.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index f515564998a6..57643ede2677 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -2235,6 +2235,7 @@ public function restWhere(&$values) { $this->_qill[$grouping][] = "$field[title] $op \"$value\""; } elseif ($name === 'email_greeting') { + CRM_Core_Error::deprecatedFunctionWarning('pass in email_greeting_id or email_greeting_display'); $filterCondition = array('greeting_type' => 'email_greeting'); $this->optionValueQuery( $name, $op, $value, $grouping, @@ -2244,6 +2245,7 @@ public function restWhere(&$values) { ); } elseif ($name === 'postal_greeting') { + CRM_Core_Error::deprecatedFunctionWarning('pass in postal_greeting_id or postal_greeting_display'); $filterCondition = array('greeting_type' => 'postal_greeting'); $this->optionValueQuery( $name, $op, $value, $grouping, @@ -2253,6 +2255,7 @@ public function restWhere(&$values) { ); } elseif ($name === 'addressee') { + CRM_Core_Error::deprecatedFunctionWarning('pass in addressee_id or addressee_display'); $filterCondition = array('greeting_type' => 'addressee'); $this->optionValueQuery( $name, $op, $value, $grouping, @@ -5965,8 +5968,8 @@ public function optionValueQuery( } } else { - // LOWER roughly translates to 'hurt my database without deriving any benefit' See CRM-19811. - $wc = self::caseImportant($op) ? "LOWER({$field['where']})" : "{$field['where']}"; + CRM_Core_Error::deprecatedFunctionWarning('pass $ids to this method'); + $wc = "{$field['where']}"; } if (in_array($name, $pseudoFields)) { if (!in_array($name, array('gender_id', 'prefix_id', 'suffix_id', 'communication_style_id'))) {