#77862TYPO3 function select properties max and begin special keyword "total" not working with joined tables
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.
Reviews 2
History 24
-
Riccardo De Contardi commented <span data-processor="relativetime" data-value="2021-09-26T15:50:04+00:00" > 09/26/21, 15:50 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 96109 status
NewUnder Review <span data-processor="relativetime" data-value="2026-09-27T09:38:54+00:00" > 09/27/26, 09:38 </span> -
Gerrit Code Review pushed patch set 1 for 14.3 to change 96134 <span data-processor="relativetime" data-value="2026-09-28T18:16:20+00:00" > 09/28/26, 18:16 </span>
-
Wouter Wolters commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-09-28T18:20:14+00:00" > 09/28/26, 18:20 </span>Applied in changeset commit:993f54c11fb8cd78000345f177f7b31664c1e5f6.
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…