#105889Problem with ContentObjectRenderer select and pidInList = root
Description
Hello,
I am using this TypoScript from the documentation https://docs.typo3.org/permalink/t3tsref:select-pidinlist:
10 = CONTENT
10 {
table = sys_category
select {
pidInList = root,-1
selectFields = sys_category.*
join = sys_category_record_mm ON sys_category_record_mm.uid_local = sys_category.uid
where.data = field:_ORIG_uid // field:uid
where.intval = 1
where.wrap = sys_category_record_mm.uid_foreign=|
orderBy = sys_category_record_mm.sorting_foreign
languageField = 0 # disable translation handling of sys_category
}
}
but it doesn’t work.
The problem seems to be in typo3/cms-frontend/Classes/ContentObject/ContentObjectRenderer.php. In the method getQuery(), starting on line 5138, the program calls in line 5207 the method $this->getTypoScriptFrontendController()->sys_page->getPageIdsRecursive(). This method transforms with
$pageIds = array_map('intval', $pageIds);
all entries in pidInList in integers.
Back in ContentObjectRenderer.php on on line 5217 the programm calls $this->getQueryConstraints(), which checks on line 5463 if pidInList contains ‘root’ but that got already transformed into the integer 0. So the example from the documentation doesn’t work.
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] Problem with ContentObjectRenderer select and pidInList = root Resolves: #105889 Releases: main