Issue Bug Resolved

#111256Ambiguous column "tablenames" in menu_categorized_content query

Tung Ngo 10/27/26, 08:55 updated 10/28/26, 09:25

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

  1. Garvin Hicking commented and changed status Under Review Resolved done 0 % 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.