Skip to content

Commit

Permalink
Further removal of instance of using LOWER() rather than relying on m…
Browse files Browse the repository at this point in the history
…ysql 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
  • Loading branch information
eileenmcnaughton committed Aug 2, 2018
1 parent e009a72 commit 553a5bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -2253,6 +2255,7 @@ public function restWhere(&$values) {
);
}
elseif ($name === 'addressee') {
CRM_Core_Error::deprecatedFunctionWarning('pass in addressee_id or ddressee_display');
$filterCondition = array('greeting_type' => 'addressee');
$this->optionValueQuery(
$name, $op, $value, $grouping,
Expand Down Expand Up @@ -5965,8 +5968,9 @@ public function optionValueQuery(
}
}
else {
CRM_Core_Error::deprecatedFunctionWarning('pass $ids to this method');
// LOWER roughly translates to 'hurt my database without deriving any benefit' See CRM-19811.
$wc = self::caseImportant($op) ? "LOWER({$field['where']})" : "{$field['where']}";
$wc = "{$field['where']}";
}
if (in_array($name, $pseudoFields)) {
if (!in_array($name, array('gender_id', 'prefix_id', 'suffix_id', 'communication_style_id'))) {
Expand Down

0 comments on commit 553a5bc

Please sign in to comment.