diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php index 5d45a1270c62cb8e0cd17a1400350b59cd04aad5..1a96445b11d558bfd939c49491d4090232d09b10 100644 --- a/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php +++ b/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php @@ -943,6 +943,7 @@ abstract class AbstractItemProvider $foreignTableClauseArray = $this->processForeignTableClause($result, $foreignTableName, $localFieldName); $fieldList = BackendUtility::getCommonSelectFields($foreignTableName, $foreignTableName . '.'); + /** @var QueryBuilder $queryBuilder */ $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable($foreignTableName); @@ -956,7 +957,7 @@ abstract class AbstractItemProvider ->where($foreignTableClauseArray['WHERE']); if (!empty($foreignTableClauseArray['GROUPBY'])) { - $queryBuilder->groupBy($foreignTableClauseArray['GROUPBY']); + $queryBuilder->groupBy(...$foreignTableClauseArray['GROUPBY']); } if (!empty($foreignTableClauseArray['ORDERBY'])) { diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php index b577626a224b2767a78cda7e6f8dd0679ba2b10c..feba4515c43c9863d4cc6735b341b232401405d4 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php @@ -1754,7 +1754,7 @@ class TcaSelectItemsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase 'foreign_table' => 'fTable', 'foreign_table_where' => ' AND ftable.uid=1 - GROUP BY groupField + GROUP BY groupField1, groupField2 ORDER BY orderField LIMIT 1,2', ], @@ -1779,7 +1779,7 @@ class TcaSelectItemsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase $queryBuilderProphet->select('fTable.uid')->shouldBeCalled()->willReturn($queryBuilderProphet->reveal()); $queryBuilderProphet->from('fTable')->shouldBeCalled()->willReturn($queryBuilderProphet->reveal()); $queryBuilderProphet->from('pages')->shouldBeCalled()->willReturn($queryBuilderProphet->reveal()); - $queryBuilderProphet->groupBy(['groupField'])->shouldBeCalled()->willReturn($queryBuilderProphet->reveal()); + $queryBuilderProphet->groupBy('groupField1', 'groupField2')->shouldBeCalled()->willReturn($queryBuilderProphet->reveal()); $queryBuilderProphet->addOrderBy('orderField', null)->shouldBeCalled()->willReturn($queryBuilderProphet->reveal()); $queryBuilderProphet->setFirstResult(1)->shouldBeCalled()->willReturn($queryBuilderProphet->reveal()); $queryBuilderProphet->setMaxResults(2)->shouldBeCalled()->willReturn($queryBuilderProphet->reveal());