Review 11.5 Merged

83524[BUGFIX] Ensure working count query in `DatabaseRecordList::getTable()`

Stefan Bürk CR +2 V +2 Easy +3 −1 updated 04/08/24, 09:46

Commit message

`\TYPO3\CMS\Backend\RecordList\DatabaseRecordList` provides the ability
to modify the QueryBuilder used for the record list representation with
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][DatabaseRecordList::class]['modifyQuery']
after generic query information like default orderings and similar have
been added.

That is covered within the `getQueryBuilder()` method, which is used in
other class methods, for example in `getTables()` where it is changed
to a `COUNT()` query.

MariaDB for example is picky about count queries using `order by`,
`group by` or aggregation methods which are not reflected or added
in the counter parts leading to a not so useful error like

  Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP
  columns is illegal if there is no GROUP BY clause

or similar variants. This error message can be missleading for the
case a order by has been used along with a COUNT() query.

Hook consumer do not get the information if order-by can be added
or should be left out, therefore maybe adding sorting conditions
for a count query.

This change now resets any order statements for the count-query
like other places in the TYPO3 core.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 712

  1. Stefan Bürk uploaded patch set 1 03/19/24, 14:53

  2. core-ci voted on patch set 1 V -1 03/19/24, 15:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54700

  3. Stefan Bürk uploaded patch set 2 V -1 03/27/24, 10:46

  4. core-ci voted on patch set 2 V -1 03/27/24, 10:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54993

  5. Stefan Bürk uploaded patch set 3 V -1 03/27/24, 11:13

  6. core-ci voted on patch set 3 V -1 03/27/24, 11:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54996

  7. core-ci commented on patch set 3 03/27/24, 11:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54996

  8. Stefan Bürk uploaded patch set 4 V -1 03/27/24, 13:50

  9. core-ci voted on patch set 4 V +1 03/27/24, 14:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55000

  10. Garvin Hicking voted on patch set 4 CR +1 V +1 04/04/24, 15:19

  11. Stefan Bürk voted on patch set 4 CR +2 V +2 04/08/24, 09:46

  12. Stefan Bürk merged patch set 5 04/08/24, 09:46