Project

General

Profile

Actions

Bug #84738

closed

Doctrine\DBAL\Exception\SyntaxErrorException in CType: menu_categorized_content

Added by Georg Tiefenbrunn over 6 years ago. Updated about 6 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 #1

Updated by Gerrit Code Review over 6 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56679

Actions #2

Updated by Georg Ringer over 6 years ago

instead of fixing the TS I propose to fix the UI and force editors to define categories

Actions #3

Updated by Georg Tiefenbrunn over 6 years ago

Georg Ringer wrote:

instead of fixing the TS I propose to fix the UI and force editors to define categories

Yes, that's the better solution!

Actions #4

Updated by Gerrit Code Review over 6 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56684

Actions #5

Updated by Georg Ringer over 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF