#111256Ambiguous column "tablenames" in menu_categorized_content query
Description
Description:
The database query of the content element “Categorized content” (`menu_categorized_content`) joins `sys_category_record_mm`, but uses the columns `tablenames` and `fieldname` without a table name in its `where`:
where.wrap = {#tablenames}='tt_content' and {#fieldname}='|'
As soon as `tt_content` has a column with the same name, the query fails. This happens e.g. with an inline field to `tt_content` that uses `foreign_table_field = tablenames` (Content Blocks `shareAcrossTables`, same convention as `sys_file_reference`):
#1052 Doctrine\DBAL\Exception\NonUniqueFieldNameException: An exception occurred while executing a query: Column 'tablenames' in WHERE is ambiguous
Steps to reproduce:
1. Make sure `tt_content` has a column `tablenames`, e.g. via an inline field (or Content Blocks Collection) with `foreign_table: tt_content` and `foreign_table_field: tablenames`, then run the database compare.
Quick test: `ALTER TABLE tt_content ADD tablenames varchar(255) DEFAULT ‘’ NOT NULL;`
2. Create a “Categorized content” element and select any category.
3. Open the page in the frontend.
Expected: The element lists the categorized content.
**Actual:** Exception above.
Possible fix: qualify both columns with `{#sys_category_record_mm}`, like the `join.wrap` above it.
File: `typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/MenuCategorizedContent.typoscript`
Reviews 2
Files 1
History 17
-
Gerrit Code Review pushed patch set 1 for main to change 97174 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-27T09:14:19+00:00" > 10/27/26, 09:14 </span> -
Gerrit Code Review pushed patch set 2 for main to change 97174 <span data-processor="relativetime" data-value="2026-10-27T09:21:18+00:00" > 10/27/26, 09:21 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 97174 <span data-processor="relativetime" data-value="2026-10-27T21:52:37+00:00" > 10/27/26, 21:52 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 97182 <span data-processor="relativetime" data-value="2026-10-27T22:24:53+00:00" > 10/27/26, 22:24 </span>
-
Gerrit Code Review pushed patch set 2 for 14.3 to change 97182 <span data-processor="relativetime" data-value="2026-10-27T23:08:04+00:00" > 10/27/26, 23:08 </span>
-
Gerrit Code Review pushed patch set 3 for 14.3 to change 97182 <span data-processor="relativetime" data-value="2026-10-28T08:43:48+00:00" > 10/28/26, 08:43 </span>
-
Garvin Hicking commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-28T09:25:16+00:00" > 10/28/26, 09:25 </span>
Applied in changeset commit:f1bad9cfc777fde83524258afaf6709282e007ea.