Bug #89498
Updated by Jan Kiesewetter about 5 years ago
Envireonment: A site with multible languages and categorised content elements. On a overview page we use the fsc ctype menu_categorized_content to display all ces related to a branch (category). On the page with the default language menu_categorized_content returns all ces related to the category. Perfect! On the translated page menu_categorized_content doesn't return any ce. After checking the sql query there are two problems. Query in default language: <pre><code class="sql"> SELECT tt_content.* FROM `tt_content` INNER JOIN `sys_category_record_mm` ON uid = sys_category_record_mm.uid_foreign AND sys_category_record_mm.uid_local IN(18) WHERE (`tt_content`.`pid` IN (1, 2, 3, 4, 5, 6, 7, 8, 9)) AND (tablenames='tt_content' and fieldname='categories') AND (`tt_content`.`sys_language_uid` IN (0, -1)) AND ((`tt_content`.`deleted` = 0) AND (`tt_content`.`t3ver_state` <= 0) AND (`tt_content`.`pid` <> -1) AND (`tt_content`.`hidden` = 0) AND (`tt_content`.`starttime` <= 1571910180) AND ((`tt_content`.`endtime` = 0) OR (`tt_content`.`endtime` > 1571910180)) AND (((`tt_content`.`fe_group` = '') OR (`tt_content`.`fe_group` IS NULL) OR (`tt_content`.`fe_group` = '0') OR (FIND_IN_SET('0', `tt_content`.`fe_group`)) OR (FIND_IN_SET('-2', `tt_content`.`fe_group`)) OR (FIND_IN_SET('13', `tt_content`.`fe_group`))))) GROUP BY `uid` ORDER BY `tt_content`.`header` ASC </code></pre> Query in lang 1: <pre><code class="sql"> SELECT tt_content.* FROM `tt_content` INNER JOIN `sys_category_record_mm` ON uid = sys_category_record_mm.uid_foreign AND sys_category_record_mm.uid_local IN(18) WHERE (`tt_content`.`pid` IN (1, 2, 3, 4, 5, 6, 7, 8, 9)) AND (tablenames='tt_content' and fieldname='0') AND (`tt_content`.`sys_language_uid` IN (0, -1)) AND ((`tt_content`.`deleted` = 0) AND (`tt_content`.`t3ver_state` <= 0) AND (`tt_content`.`pid` <> -1) AND (`tt_content`.`hidden` = 0) AND (`tt_content`.`starttime` <= 1571909640) AND ((`tt_content`.`endtime` = 0) OR (`tt_content`.`endtime` > 1571909640)) AND (((`tt_content`.`fe_group` = '') OR (`tt_content`.`fe_group` IS NULL) OR (`tt_content`.`fe_group` = '0') OR (FIND_IN_SET('0', `tt_content`.`fe_group`)) OR (FIND_IN_SET('-2', `tt_content`.`fe_group`)) OR (FIND_IN_SET('13', `tt_content`.`fe_group`))))) GROUP BY `uid` ORDER BY `tt_content`.`header` ASC </code></pre> Problems in the query: 1: <pre><code class="sql"> (tablenames='tt_content' and fieldname='0') </code></pre> Seems like "data = field:category_field" returns 0 in non default lannguage. https://github.com/TYPO3/TYPO3.CMS/blob/v8.7.28/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/MenuCategorizedContent.txt#L19 2: <pre><code class="sql"> (`tt_content`.`sys_language_uid` IN (0, -1) </code></pre> It just queries default and all language records instead of the current language. The first I have workedaround with fixing the fieldname <pre><code class="text"> tt_content.menu_categorized_content.dataProcessing.10.where > tt_content.menu_categorized_content.dataProcessing.10.where = {#tablenames}='tt_content' tablenames={#tt_content} and {#fieldname}='categories' fieldname={#categories} </code></pre> For problem 2 I haven't a workaround yet.