Issue Bug Closed

#62277TCA > Config > type group - foreign_table necessary for extbase to work

Mats Nygaard 10/16/14, 12:26 updated 12/02/25, 14:36

Description

Having the following TCA for an object:

'config' => array(
    'type' => 'group',
    'internal_type' => 'db',
    'allowed' => 'pages',
    'MM' => 'tx_tcteaser_mm',
    'MM_insert_fields' => array('tablename' => 'tx_tcteaser_domain_model_teaser'),
    'MM_match_fields' => array('tablename' => 'tx_tcteaser_domain_model_teaser'),
    'size' => 10,
    'minitems' => 0,
    'maxitems' => 9999,
),

it works fine in the backend. However, in the frontend, using extbase, all repository calls, ie. findAll(), generates an error, where lastBuiltQuery is this:

SELECT .* FROM tx_tcteaser_mm LEFT JOIN ON tx_tcteaser_mm.uid_foreign = .uid WHERE (tx_tcteaser_mm.uid_local = 1 AND tx_tcteaser_mm.tablename = ‘tx_tcteaser_domain_model_teaser’) ORDER BY tx_tcteaser_mm.sorting ASC

As you can see, the foreign table is not known.

By adding foreign_table (in this case ‘pages’) to the config, the error disappears, and everything is fine.

But – foreign_table is not mentioned in the documentation for “group” at all.

Should foreign_table be added OR is this an axtbase bug?

Reviews 2

History 915

  1. Mats Nygaard commented <span data-processor="relativetime" data-value="2014-10-16T13:23:40+00:00" > 10/16/14, 13:23 </span>

    Additionally, the documentation for group > mm (http://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Group/Index.html#mm) mentions a required table field “tablenames”. This won’t work for me, but renaming the field to “tablename” seems to do the job. Actually, “tablename” is mentioned on the same page, here: http://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Group/Index.html#columns-group-data-mm

    Again, documentation glitch or code glitch?

  2. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2015-07-30T16:10:01+00:00" > 07/30/15, 16:10 </span>

    Extbase expects “foreign_table” to contain exactly one table name compared to “allowed” which can hold a list of table names.
    (see http://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Group/Index.html#columns-group-properties-foreign-table)
    this limitation is still present in Extbase and will be handled in the future; the documentation about it already got an opened issue (see https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-TCA/pull/36)

  3. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-04-07T19:55:08+00:00" > 04/07/25, 19:55 </span>

    Applied in changeset commit:3f1a68654cbea25438a543b66a1722563fe6a2df.

  4. Gerrit Code Review pushed patch set 1 for 13.4 to change 88967 status Resolved Under Review <span data-processor="relativetime" data-value="2025-04-07T19:56:04+00:00" > 04/07/25, 19:56 </span>

  5. Benni Mack commented and changed status Under Review Resolved <span data-processor="relativetime" data-value="2025-04-08T08:30:11+00:00" > 04/08/25, 08:30 </span>

    Applied in changeset commit:965c9c4a33f9b0257fae96a9bae0b1a6c5aef51d.