Issue Bug Closed

#99035Automatic mm-table generation fails on multiple allowed tables

Alexander Grein 11/09/22, 20:13 updated 03/24/25, 21:33

Description

This TCA configuration generates the following sql table, where the necessary field “tablenames” is missing:

'fieldname' => [
    'label' => 'Label',
    'config' => [
        'type' => 'group',
        'internal_type' => 'db',
        'allowed' => 'tt_address,fe_users,fe_groups',
        'MM' => 'tx_my_group_mm',
        'size' => '20',
    ],
],
CREATE TABLE `tx_my_group_mm` (
  `uid_local` int(10) unsigned NOT NULL DEFAULT 0,
  `uid_foreign` int(10) unsigned NOT NULL DEFAULT 0,
  `sorting` int(10) unsigned NOT NULL DEFAULT 0,
  `sorting_foreign` int(10) unsigned NOT NULL DEFAULT 0,
  KEY `uid_local` (`uid_local`),
  KEY `uid_foreign` (`uid_foreign`)
);

Since TYPO3 11.4 the MM table should be generated as needed automatically, which obviously is not working in this case:
https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/CommonProperties/Mm.html#auto-creation-of-intermediate-mm-tables-from-tca

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 1

  1. Georg Ringer commented and changed status New Closed 03/24/25, 21:33

    tested that in main and generated sql is

    CREATE TABLE `tx_my_group_mm`
      (
         `uid_local`       INT UNSIGNED DEFAULT 0 NOT NULL,
         `uid_foreign`     INT UNSIGNED DEFAULT 0 NOT NULL,
         `sorting`         INT UNSIGNED DEFAULT 0 NOT NULL,
         `sorting_foreign` INT UNSIGNED DEFAULT 0 NOT NULL,
         `tablenames`      VARCHAR(64) DEFAULT '' NOT NULL,
         `fieldname`       VARCHAR(64) DEFAULT '' NOT NULL,
         INDEX `uid_local` (uid_local),
         INDEX `uid_foreign` (uid_foreign),
         PRIMARY KEY(uid_local, uid_foreign, tablenames, fieldname)
      )
    engine = innodb
    row_format = dynamic 

    so that looks ok now, therefore closing issue