Bug #33700
closed
Invalid behavior of search for integer in Backend search
Added by Xavier Perseguers about 12 years ago.
Updated over 5 years ago.
Description
Backend search (and Live search once #31761 has been merged) do not behave as stated in the 4.6 Release notes (http://wiki.typo3.org/TYPO3_4.6#Live_Search):
In previous TYPO3 versions, there were several problems with Backend search:
- ...
- it searched "uid" and other numeric fields even if the value was not numeric
- it used LIKE x search on numeric fields
- ...
In fact current implementation does not replace the LIKE operator with an SQL equal statement for numeric fields but whenever a query that can be interpreted as integer is encountered, regardless of the underlying column type.
Example: If you have pages "102 W", "102 E", you used to be able to search for "102" and get them, but now the query is casted to an integer and the page title is search for an equality on "102" resulting in an empty result list.
The underlying column type should be used instead (code to cache this information is already available within DBAL and Helmut started months ago to backport it to Core itself: #28654).
Files
Xavier, here's a patch for this issue. I'm not sure what you meant about the caching stuff, but it doesn't seem to be committed yet, but the bug still needs to be fixed. Therefore I wanted your opinion before pushing this patch for review.
NOTE: this patch is only for live search, if you agree with it, I'll adapt it for BE search too.
Why isn't this patch commited yet, not even in 4.7?
I have a table with date field that I used to search with strings as '20120510' and now it just does not work. This search ability is crucial to my site editors.
Had to temporary fix it by hand.
Please commit! And also in BE search.
I don't know if this patch also solves this problem:
string fields containing just numbers will not be found via live search.
Example:
If page title '112' can not be found via live search.
Search interpretes input as int and does not look into string fields, right?
Hi all,
tested this patch successfully in live search. My testcase was to search a zipcode in feusers. Without the patch the feuser was not found and with the patch the feuser was found.
Greetings
Marco :-)
The patch really needs to be committed for both live search and regular BE search. For us, searching in BE is, unfortunately, pretty much useless as is.
For some reason I'm not able to fix it by XCLASSing (modified classes are not loaded), and with no hooks, I'm left with modifying the core directly.
EDIT: We're currently using TYPO3 v4.7.2
Regards
Mads
- Status changed from New to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Under Review
- Status changed from Under Review to Resolved
- Status changed from Resolved to Closed
Also available in: Atom
PDF