Issue Bug Resolved

#107796Add table in searchContraint for DatabaseRecordList

Ludovic Nogueira 10/21/25, 07:21 updated 05/02/26, 15:50

Description

The other day, using TYPO3 10 + 11, I had to update the “makeSearchString” of DatabaseRecordList to include fields from a joined table in the search.

I had no issue up until a MySQL error “Column ‘name’ in field list is ambiguous”. This is because the constraint build in “makeSearchString” don’t use the current “$table“
clipboard-202510210900-co3uh.png

And since you can’t read the data from “CompositeExpression” from the queryBuilder constraints, you can’t add the table for an easy fix.

The workaround was to remove the field “name” in my TCA [‘ctrl’][‘searchFields’] and add it back in my hook with the table written.
clipboard-202510210905-4kywo.png

Since TYPO3 provide a hook, or an event in newer versions, I think it’s normal that the table name is provided by default in the where clause.

Reviews 3