Actions
Feature #93450
openContentObjectRenderer: allow TypoScript select object without any constraint of uidInList or pidInList
Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
-
Start date:
2021-02-05
Due date:
% Done:
0%
Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:
Description
Current state¶
A TypoScript select object must have at least one constraint of uid
or pid
- configured via properties uidInList and pidInList
Feature proposal¶
Allow to completely disable the pid_uid constraint on purpose in ContentObjectRenderer.
10 = CONTENT
10 {
table =
select {
uidInList = 0
pidInList = 0
}
}
Motivation¶
Get records from a m:n-relation where you already know the uids
of one side.
Tables respresenting m:n-relations do not have a field named uid
- instead they have uid_local
and uid_foreign
.
As a current work-around you must pre-fill pidInList
with all pids
of the entire database to make this work:
pidInList.data = leveluid : 0
recursive = 99
Example code taken from tt_content.menu_categorized_content
tt_content.menu_categorized_content =< lib.contentElement
tt_content.menu_categorized_content {
templateName = MenuCategorizedContent
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
10 {
table = tt_content
selectFields = tt_content.*
groupBy = uid
pidInList.data = leveluid : 0
recursive = 99
join.data = field:selected_categories
join.wrap = sys_category_record_mm ON uid = sys_category_record_mm.uid_foreign AND sys_category_record_mm.uid_local IN(|)
where.data = field:category_field
where.wrap = tablenames='tt_content' and fieldname='|'
orderBy = tt_content.sorting
as = content
}
}
}
Code base¶
TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer - L6078-L6081
// If not uid and not pid then uid is set to 0 - which results in nothing!!
if (!$pid_uid_flag) {
$constraints[] = $expressionBuilder->eq($table . '.uid', 0);
}
Actions