Bug #40347
closedBackend Search doesn't find its own data sets
100%
Description
I have in a Sysfolder own data from a own extension.
I have set the searchField in TCA-Confuguration (ext_tables.php)
There is a inputfield:
'xxxx_id' => array( 'exclude' => 1, 'label' => '......................', 'config' => array( 'type' => 'input', 'size' => '45', 'eval' => 'tx_.....datenbank..._id,required', ) ),
The format of this field ist xxxx.xxxxx.xxxx (example: 1245.01024.0068, 1245.01554.0678, 2265.01824.2268, ...).
When i search for '1245' I find no results.
For searchstring '1245.', i find all data (starts with 1245).
The Problem is in file typo3/class.db_list.inc line 555.
if (t3lib_utility_Math::canBeInterpretedAsInteger($this->searchString)) {
My searchstring was interpreted as integer and the function makeSearchString returns only
AND uid = 1245
The second problem in this function is in lines 592-594.
if ($fieldConfig['type'] == 'text' || $fieldConfig['type'] == 'flex' || ($fieldConfig['type'] == 'input' && (!$fieldConfig['eval'] || !preg_match('/date|time|int/',$fieldConfig['eval'])))) { $whereParts[] = sprintf($format, $fieldName, $like); }
I have a user function in eval. The name of this function is 'tx_.....datenbank..._id'.
The condition
'!preg_match('/date|time|int/',$fieldConfig['eval'])'
find string 'date' in this name, and so fails including this field in the querystring.
Updated by Florian Schaeffer almost 12 years ago
I have the same issue, using item number as searchable field, most of the time my items have a "real" itemnumber, like 11225588000.
Nevertheless the number could be alphanumeric, so I won't have any eval = int - rule in my TCA.
So I also would opt for an option to enable a searchField handling "like text" although the fields value could be interpreted as int ... Something like searchOption = text....
No real patch at hand, I usually disable the first part of that comparison (line 555 of class.dblist.inc), so every search is done as text search (performance lags of course).
if (t3lib_utility_Math::canBeInterpretedAsInteger($this->searchString) && 1==2) {
Updated by Mathias Schreiber almost 10 years ago
- Target version set to 7.4 (Backend)
- Is Regression set to No
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Benni Mack about 9 years ago
- Target version changed from 7.5 to 7 LTS
Updated by Daniel Goerz almost 9 years ago
- Description updated (diff)
Putting the code from the description in pre tags.
Updated by Gerrit Code Review about 5 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61885
Updated by Gerrit Code Review about 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61885
Updated by Gerrit Code Review almost 5 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61885
Updated by Gerrit Code Review almost 5 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62792
Updated by Christian Eßl almost 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f1587a98253683a98635d27c73b54e4c1eb9e9c2.