Bug #77862
openTYPO3 function select properties max and begin special keyword "total" not working with joined tables
0%
Description
Properties max and begin inside select function have special keyword "total" which should have total number of records.
In getQuery function in \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer first is to set limit and after that if there is no errors setting up table joins.
Limit use $queryParts['where'] and it cause problem if in where clause of select we have condition on joined table.
Here is example:
lib.someContent = CONTENT
lib.someContent {
table = tx_extension_domain_model_model2
select {
pidInList = 1
join = tx_extension_model1_model2_mm ON tx_extension_model1_model2_mm.uid_foreign = tx_extension_domain_model_model2.uid
where = tx_extension_model1_model2_mm.uid_local = 1
max = total - 1
}
}
In this example we will have error like unknown column tx_extension_model1_model2_mm.uid_local because in this step tables are not joined yet.
Updated by Riccardo De Contardi about 3 years ago
On the latest documentation
https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/Functions/Select.html#max
I've found the line:
Special keyword: “total” is substituted with
count(*)
.
I don't know if this affects this issue...