Issue Bug Resolved

#77862TYPO3 function select properties max and begin special keyword "total" not working with joined tables

Sinisa Mitrovic 09/06/16, 15:05 updated 09/28/26, 18:20

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

  1. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2021-09-26T15:50:04+00:00" > 09/26/21, 15:50 </span>

    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…

  2. Wouter Wolters commented and changed status Under Review Resolved done 0 % 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.