[BUGFIX] Invalid behavior of search for integer in Backend search
[Packages/TYPO3.CMS.git] / typo3 / sysext / recordlist / Classes / RecordList / AbstractDatabaseRecordList.php
index 027163e..a68d32d 100644 (file)
@@ -633,12 +633,18 @@ 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'];
+                                                       $condition = $fieldName . '=' . $this->searchString;
                                                        if ($fieldConfig['type'] == 'input' && $fieldConfig['eval'] && \TYPO3\CMS\Core\Utility\GeneralUtility::inList($fieldConfig['eval'], 'int')) {
-                                                               $condition = $fieldName . '=' . $this->searchString;
                                                                if (is_array($fieldConfig['search']) && in_array('pidonly', $fieldConfig['search']) && $currentPid > 0) {
                                                                        $condition = '(' . $condition . ' AND ' . $tablePidField . '=' . $currentPid . ')';
                                                                }
                                                                $whereParts[] = $condition;
+                                                       } elseif (
+                                                               $fieldConfig['type'] == 'text' ||
+                                                               $fieldConfig['type'] == 'flex' ||
+                                                               ($fieldConfig['type'] == 'input' && (!$fieldConfig['eval'] || !preg_match('/date|time|int/', $fieldConfig['eval'])))) {
+                                                                       $condition = $fieldName . ' LIKE \'%' . $this->searchString . '%\'';
+                                                                       $whereParts[] = $condition;
                                                        }
                                                }
                                        }
@@ -964,4 +970,4 @@ class AbstractDatabaseRecordList extends \TYPO3\CMS\Backend\RecordList\AbstractR
 }
 
 
-?>
\ No newline at end of file
+?>