Bug #40347

Backend Search doesn't find its own data sets

Added by Mirko grothe over 7 years ago. Updated 25 days ago.

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

100%

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.

Associated revisions

Revision f1587a98 (diff)
Added by Christian Eßl 25 days ago

[BUGFIX] Fix /date|time|int/ regex in backend search

Several parts of the core use the regular expression /date|time|int/ to
test, if an 'eval' TCA configuration of a field contains one of these
evaluation strings. This regex would however match any other string that
contains one of those words. This patch fixes this behaviour by matching
only the exact words.

Resolves: #40347
Releases: master, 9.5
Change-Id: I2af1e3bf5b5cc4056f0e3875645c549a01e6dbd0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61885
Tested-by: Oliver Hader <>
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Reviewed-by: Oliver Hader <>
Reviewed-by: Benni Mack <>

Revision 357f4df7 (diff)
Added by Christian Eßl 25 days ago

[BUGFIX] Fix /date|time|int/ regex in backend search

Several parts of the core use the regular expression /date|time|int/ to
test, if an 'eval' TCA configuration of a field contains one of these
evaluation strings. This regex would however match any other string that
contains one of those words. This patch fixes this behaviour by matching
only the exact words.

Resolves: #40347
Releases: master, 9.5
Change-Id: I2af1e3bf5b5cc4056f0e3875645c549a01e6dbd0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62792
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Reviewed-by: Benni Mack <>

History

#1 Updated by Florian Schaeffer about 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 about 5 years ago

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

#3 Updated by Susanne Moog over 4 years ago

  • Target version changed from 7.4 (Backend) to 7.5

#4 Updated by Benni Mack over 4 years ago

  • Target version changed from 7.5 to 7 LTS

#5 Updated by Mathias Schreiber about 4 years ago

  • Target version deleted (7 LTS)

#6 Updated by Daniel Goerz about 4 years ago

  • Description updated (diff)

Putting the code from the description in pre tags.

#7 Updated by Gerrit Code Review 4 months 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 3 months 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

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

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

#11 Updated by Christian Eßl 25 days ago

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

Also available in: Atom PDF