I am not sure how to describe it.... I am trying to search for certain values such as first name, last name, etc. using backend search on my own records but addressing a different table fe_users
. The relation is present and is also correct.
Example:
When I search for the username, first_name or last_name I receive 0 results:
That´s my TCA:
return [
'ctrl' => [
'title' => 'My custom Plugin',
'label' => 'user',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'versioningWS' => false,
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'transOrigDiffSourceField' => 'l10n_diffsource',
'delete' => 'deleted',
'enablecolumns' => [
'disabled' => 'hidden',
'starttime' => 'starttime',
'endtime' => 'endtime',
],
'searchFields' => 'user, customId',
'iconfile' => '' // todo
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, user, customId',
],
'types' => [
'1' => [
'showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, user, customId'
],
],
'columns' => [
'user' => [
'label' => 'FE-User',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'fe_users',
'readOnly' => true
],
],
'customId' => [
'label' => 'My custom plugin',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'tt_content',
'readOnly' => true,
'size' => 1
]
]
],
];
Is it easy to implement? Am I missing a configuration perhaps?
The search does not resolve relations but only takes the searchFields
into account. So you could use a hook of the DataHandler and add values of some fields of the related user to a readonly field of your table and make that searchable.