Project

General

Profile

Actions

Bug #40347

closed

Backend Search doesn't find its own data sets

Added by Mirko grothe about 12 years ago. Updated over 4 years ago.

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

100%

Estimated time:
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.

Actions #1

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) {
Actions #2

Updated by Mathias Schreiber almost 10 years ago

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

Updated by Susanne Moog over 9 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #4

Updated by Benni Mack about 9 years ago

  • Target version changed from 7.5 to 7 LTS
Actions #5

Updated by Mathias Schreiber about 9 years ago

  • Target version deleted (7 LTS)
Actions #6

Updated by Daniel Goerz almost 9 years ago

  • Description updated (diff)

Putting the code from the description in pre tags.

Actions #7

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

Actions #8

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

Actions #9

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

Actions #10

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

Actions #11

Updated by Christian Eßl almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #12

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF