Bug #40347

Backend Search doesn't find its own data sets

Added by Mirko grothe about 7 years ago. Updated 8 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-08-28
Due date:
% Done:

0%

TYPO3 Version:
4.7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.

History

#1 Updated by Florian Schaeffer almost 7 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) {

#2 Updated by Mathias Schreiber almost 5 years ago

  • Target version set to 7.4 (Backend)
  • Is Regression set to No

#3 Updated by Susanne Moog about 4 years ago

  • Target version changed from 7.4 (Backend) to 7.5

#4 Updated by Benni Mack about 4 years ago

  • Target version changed from 7.5 to 7 LTS

#5 Updated by Mathias Schreiber almost 4 years ago

  • Target version deleted (7 LTS)

#6 Updated by Daniel Goerz almost 4 years ago

  • Description updated (diff)

Putting the code from the description in pre tags.

#7 Updated by Gerrit Code Review 19 days 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

#8 Updated by Gerrit Code Review 8 days 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

Also available in: Atom PDF