#85284Workspace shows unchecked sectionIndex in preview
Description
If you uncheck sectionIndex (Show in Section Menus) of a tt_content it will still be shown in the Workspace preview.
It looks like the WS preview doesn’t care about sectionIndex=0 and show it anyway.
Also true for the Menu sections in WS Preview: The tt_content will be in the list even with sectionIndex=0
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[BUGFIX] Workspace shows unchecked sectionIndex in preview Resolves: #85284 Releases: main
Related issues 5
- Bug #85934DatabaseQueryProcessor - doesn't respect the translation config
- Bug #88071Language overlay in DatabaseQueryProcessor
- Bug #88072Language overlay in DatabaseQueryProcessor
- Bug #93336Enabling translated content in workspace is not previewable
- Bug #109203ContentObjectRenderer getRecords does not properly respect default language hidden value when overlays are disabled
History 14
-
Riccardo De Contardi commented <span data-processor="relativetime" data-value="2019-03-28T23:04:36+00:00" > 03/28/19, 23:04 </span>
-
Christian Kuhn commented <span data-processor="relativetime" data-value="2020-07-30T14:54:36+00:00" > 07/30/20, 14:54 </span>
Great reproduce information again, Riccardo. Thank you! Issue still confirmed in current master.
-
Christian Kuhn changed Related to #85934 <span data-processor="relativetime" data-value="2020-07-30T17:46:09+00:00" > 07/30/20, 17:46 </span>
-
Christian Kuhn changed Related to #88071 <span data-processor="relativetime" data-value="2020-07-30T19:40:29+00:00" > 07/30/20, 19:40 </span>
-
Christian Kuhn commented <span data-processor="relativetime" data-value="2020-07-30T20:18:42+00:00" > 07/30/20, 20:18 </span>
Ok, here is the thing:
Content elements in core are rendered via fluid_styled_content (by default, since which version exactly?). In case of content element based sectionIndex menues, the according file is ext:fluid_styled_content/Configuration/TypoScript/ContentElement/MenuSection.typoscript
This file uses that snipped for the query:
... 20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor 20 { table = tt_content pidInList.field = uid as = content where = sectionIndex = 1 orderBy = sorting dataProcessing { 10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor 10 { references.fieldName = image } } } ...This triggers class DatabaseQueryProcessor with the query config. The class calls ContentObjectRenderer->getRecords() which creates a query via exec_getQuery() and receives the (always live, no language overlay, no workspace overlay) records. Those records are then overlayed with workspace versions and languages.
So the result rows DO have the sectionIndex=0 field set correctly, because they have been overlayed.
However, that row information is now too late and rows are NOT filtered again, eg. by given where restriction … because, well, the query is done already. Thus, the record (“element 3” in Riccardos example) is rendered.
One could imagine a hack in ContentObjectRenderer->getQuery() trying to parse typoscript ‘where’ a second time to filter rows on PHP level. That approach however would be very limited:- First only “additional restrictions” can be applied: Filtering rows that fall out of the query, but should still not be shows. If I turn the sectionIndex from above around and set sectionIndex=0 in live record but =1 in workspace, the approach of additional filtering would fail because the row wouldn’t fall out of the query in the first place.
- Furthermore, a solution would require a parsing of a database where condition into some php pendant. This would be do-able for simple stuff like “fieldname = 42” or “fieldname > 42”, but ‘where’ can be as complex as you want and also has stdWrap properties which could lead to everything … In short, one does not want to create an sql parser in php …
- The approach is also broken for stuff like LIMIT restrictions: “give me only x number of rows” – if a php side post-filter would kick rows, there may not be enough rows coming from the query to fill up with new candidates.
BTW: The old school menu_section index content object from AbstractMenuContentObject->sectionIndex() probably handled that case in a better way, since it considers the sectionIndex=1 restriction after overlays to language and version have been done …
In general, the DatabaseQueryProcessor approach is very limited when it comes to language/version overlays and typically leads to wrong results. Issue #88071 is another example, and that one is not workspace but “just” language related. I’d actually expect more issues in this area to be reported in the future (please link those issues).
A good solution could be to do the overlays within the very same query, making the database doing overlays transparently (probably by using CTE’s) in the first place. That approach would have other significant benefits, and we’re thinking about that for some time already. It however requires deeper refactoring. Core v10 already has some important pre-work in this area to solve it, but the real work has not been done.
Thus, at the moment, this issue can’t be solved in a good way since you’d always run into further not met scenarios. At the moment, I can only give the advise to somehow hack around those cases if they really need to be solved (for instance in this case by maybe falling back to the old school way of rendering). It would be great if according workarounds could be documented for others here if anyone comes up with something.
-
Christian Kuhn changed Complexity nightmare <span data-processor="relativetime" data-value="2020-07-30T20:23:54+00:00" > 07/30/20, 20:23 </span>
-
Benni Mack changed Related to #93336 <span data-processor="relativetime" data-value="2021-01-21T09:45:14+00:00" > 01/21/21, 09:45 </span>
-
Stefano Danieli commented and changed TYPO3 Version
810 <span data-processor="relativetime" data-value="2023-04-20T14:57:17+00:00" > 04/20/23, 14:57 </span>Hi
does anyone have the solution to the problem? this bug affects Typo3 v10 /Workspace 10.4 also
-
Stefano Danieli commented and changed TYPO3 Version
1011 <span data-processor="relativetime" data-value="2023-04-21T04:59:58+00:00" > 04/21/23, 04:59 </span>Same problem with Typo3 v11 too….. and maybe also Typo3 v12.
-
Riccardo De Contardi commented <span data-processor="relativetime" data-value="2024-04-01T14:25:23+00:00" > 04/01/24, 14:25 </span>
Still reproducible on TYPO3 13.1.0-dev with the steps on my comment n°1
-
Nikita Hovratov changed Related to #88072 <span data-processor="relativetime" data-value="2024-04-24T11:19:34+00:00" > 04/24/24, 11:19 </span>
-
Marya Hachimi commented and changed TYPO3 Version
1112 <span data-processor="relativetime" data-value="2025-06-23T17:34:36+00:00" > 06/23/25, 17:34 </span>This issue also occurs in TYPO3 12.4.32 : content with sectionIndex = 0 still appears in workspace previews and section menus.
-
Daniel Siepmann changed Related to #109203 <span data-processor="relativetime" data-value="2026-03-11T07:17:38+00:00" > 03/11/26, 07:17 </span>
-
Torben Hansen commented <span data-processor="relativetime" data-value="2026-07-20T13:27:51+00:00" > 07/20/26, 13:27 </span>
Had a similar problem with sorting in a workspace preview and came up with a custom data processor to fix the behavior. I documented this in a blogpost (see https://www.derhansen.de/2026/07/how-to-fix-wrong-sorting-of-inline-records-in-a-typo3-workspace-preview.html). The same technique could basically also be used to create a workaround for the section index preview problem described in this issue.
I tried the following test on version 10.0.0-dev (latest master)
Prerequisites
Execution
[header]> write “Test 1 this should be visible in menu”[header]> write “Test 2 this should NOT be visible in menu”[header]> write “Test 3 this should be visible in menu”Results
Execution (test 2)
Results