Issue Bug Closed

#48701setChildTableName regards only $columnConfiguration['foreign_table']

Gernot Schulmeister 05/31/13, 13:08 updated 12/02/25, 14:36

Description

in Tx_Extbase_Persistence_Mapper_DataMapFactory

functions
setOneToOneRelation
setOneToManyRelation
setManyToManyRelation

$columnMap->setChildTableName($columnConfiguration[‘foreign_table’]);

but the TCA type ‘group’, internal_type ‘db’, does not necessarily provide a ‘foreign_table’ attribute, ‘allowed’ is sufficient for the table relation. But this causes an SQL Error if you make statements like

constraints[] = $query->like(‘property.relatedProperty’, ‘‘ . $searchVar . ‘’);

because the table of the property for the join is not provided in the SQL Statement

Error occurs in Version 4.7 and 6.1. Maybe fixed in the meantime. But the lines of code in the DataMapFactory are still the same.

The workaround is to set the foreign_table attribute in the TCA also for the ‘group’ type. But maybe a better solution directly in extbase would be nice?

Since this is my first report, please tell me if there is something I should do better?

Reviews 2