[TASK] Use LOWER instead of LCASE 98/37998/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Thu, 19 Mar 2015 13:47:35 +0000 (14:47 +0100)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Sun, 22 Mar 2015 14:57:20 +0000 (15:57 +0100)
Most databases have the lowercase function "LOWER", but MySQL has
also "LCASE", which is an alias for LOWER. Use LOWER now to
have a common method call.

Resolves: #65844
Releases: master, 6.2
Change-Id: I84aec1164817252b18e5affe804791e78dab94b0
Reviewed-on: http://review.typo3.org/37998
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php

index 59ff5df..a9ed1dc 100644 (file)
@@ -309,7 +309,7 @@ class LiveSearch {
                                if (isset($GLOBALS['TCA'][$tableName]['columns'][$fieldName])) {
                                        $fieldConfig = &$GLOBALS['TCA'][$tableName]['columns'][$fieldName]['config'];
                                        // Check whether search should be case-sensitive or not
-                                       $format = 'LCASE(%s) LIKE LCASE(%s)';
+                                       $format = 'LOWER(%s) LIKE LOWER(%s)';
                                        if (is_array($fieldConfig['search'])) {
                                                if (in_array('case', $fieldConfig['search'])) {
                                                        $format = '%s LIKE %s';
index 5375f6c..01b1f78 100644 (file)
@@ -643,7 +643,7 @@ class AbstractDatabaseRecordList extends \TYPO3\CMS\Backend\RecordList\AbstractR
                                        foreach ($searchableFields as $fieldName) {
                                                if (isset($GLOBALS['TCA'][$table]['columns'][$fieldName])) {
                                                        $fieldConfig = &$GLOBALS['TCA'][$table]['columns'][$fieldName]['config'];
-                                                       $format = 'LCASE(%s) LIKE LCASE(%s)';
+                                                       $format = 'LOWER(%s) LIKE LOWER(%s)';
                                                        if (is_array($fieldConfig['search'])) {
                                                                if (in_array('case', $fieldConfig['search'])) {
                                                                        $format = '%s LIKE %s';