[BUGFIX] Invalid behavior of search for integer in Backend search
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Search / LiveSearch / LiveSearch.php
index 905b7fa..5183f5a 100644 (file)
@@ -321,6 +321,13 @@ class LiveSearch {
                                        // Assemble the search condition only if the field is an integer, or is uid or pid
                                        if ($fieldName == 'uid' || $fieldName == 'pid' || $fieldConfig['type'] == 'input' && $fieldConfig['eval'] && \TYPO3\CMS\Core\Utility\GeneralUtility::inList($fieldConfig['eval'], 'int')) {
                                                $whereParts[] = $fieldName . '=' . $this->queryString;
+                                       } elseif (
+                                               $fieldConfig['type'] == 'text' ||
+                                               $fieldConfig['type'] == 'flex' ||
+                                               ($fieldConfig['type'] == 'input' && (!$fieldConfig['eval'] ||
+                                               !preg_match('/date|time|int/', $fieldConfig['eval'])))) {
+                                                       // Otherwise and if the field makes sense to be searched, assemble a like condition
+                                                       $whereParts[] = $fieldName . ' LIKE \'%' . $this->queryString . '%\'';
                                        }
                                }
                        }
@@ -470,4 +477,4 @@ class LiveSearch {
 }
 
 
-?>
\ No newline at end of file
+?>