Project

General

Profile

Actions

Bug #84738

closed

Doctrine\DBAL\Exception\SyntaxErrorException in CType: menu_categorized_content

Added by Georg Tiefenbrunn about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Fluid Styled Content
Target version:
-
Start date:
2018-04-16
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

TYPO3 CMS Version 9 (master) and 8.x
Caused by TypoScript/SQL (PHP Version does not matter)

Steps to reproduce: Create a new element with CType menu_categorized_content and do not select any Categories ('Selected categories'/tt_content.selected_categories).

Uncaught TYPO3 Exception

An exception occurred while executing 'SELECT tt_content.* FROM `tt_content` INNER JOIN ... AND sys_category_record_mm.uid_local IN() WHERE ...

Doctrine\DBAL\Exception\SyntaxErrorException thrown in file
.../vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php in line 90.

See https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/MenuCategorizedContent.txt

My quick and dirty fix (for MariaDB/MySql) is to simply add 0 to the SQL IN() part:

tt_content.menu_categorized_content.dataProcessing.10 {
  # Alter the existing query
#  join.wrap = sys_category_record_mm ON uid = sys_category_record_mm.uid_foreign AND sys_category_record_mm.uid_local IN(|)
  join.wrap = sys_category_record_mm ON uid = sys_category_record_mm.uid_foreign AND sys_category_record_mm.uid_local IN(0|)

  # OR add the zero using stdWrap
  join.stdWrap.wrap = 0|
}
Actions

Also available in: Atom PDF