[BUGFIX] Ensure working count query in `DatabaseRecordList::getTable()`
`\TYPO3\CMS\Backend\RecordList\DatabaseRecordList` provides the ability to modify the QueryBuilder used for the record list representation with the PSR-14 `ModifyDatabaseQueryForRecordListingEvent`, 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. Listener of the event 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. Resolves: #103427 Releases: main, 12.4, 11.5 Change-Id: Ie421993a1890dd6682d02f54203d538e6ae1b76c Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83532 Reviewed-by:Garvin Hicking <gh@faktor-e.de> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Garvin Hicking <gh@faktor-e.de> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Stefan Bürk <stefan@buerk.tech>
Showing
- typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php 7 additions, 1 deletion.../sysext/backend/Classes/RecordList/DatabaseRecordList.php
- typo3/sysext/backend/Classes/View/Event/ModifyDatabaseQueryForRecordListingEvent.php 1 addition, 0 deletions...s/View/Event/ModifyDatabaseQueryForRecordListingEvent.php
Please register or sign in to comment