chg: [internal] Do not convert values to lower, since collation is already case-insensitive

pull/7617/head
Jakub Onderka 2021-08-02 17:15:40 +02:00
parent 7748598750
commit 815bc91268
1 changed files with 4 additions and 4 deletions

View File

@ -175,16 +175,16 @@ class EventsController extends AppController
}
$values = array();
foreach ($value as $v) {
$values[] = '%' . strtolower($v) . '%';
$values[] = '%' . mb_strtolower($v) . '%';
}
// get all of the attributes that have a hit on the search term, in either the value or the comment field
// This is not perfect, the search will be case insensitive, but value1 and value2 are searched separately. lower() doesn't seem to work on virtualfields
$subconditions = array();
foreach ($values as $v) {
$subconditions[] = array('lower(value1) LIKE' => $v);
$subconditions[] = array('lower(value2) LIKE' => $v);
$subconditions[] = array('lower(Attribute.comment) LIKE' => $v);
$subconditions[] = array('Attribute.value1 LIKE' => $v);
$subconditions[] = array('Attribute.value2 LIKE' => $v);
$subconditions[] = array('Attribute.comment LIKE' => $v);
}
$conditions = array(
'OR' => $subconditions,