Bug #82159
closedGROUP BY support broken in TCA foreign_table_where
100%
Description
\TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider->buildForeignTableQueryBuilder()
calls
\TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider->processForeignTableClause()
which returns an array with the processed query parts from the foreign_table_where.
The GROUPBY part is an array, since the function explicitly explodes the GROUP BY fields.
This is then passed on to
if (!empty($foreignTableClauseArray['GROUPBY'])) {
$queryBuilder->groupBy($foreignTableClauseArray['GROUPBY']);
}
where it all goes wrong. This method uses the variadic operator "..." for $groupby, which contains remaining (in this case all) arguments as an array. So now we have a multi-dimensional array, where the ensuing code expects a flat array. When it attempts to quote identifiers, it ends up passing an array to strpos(), consistently causing a PHP error.
The end-result is that any attempt to create or edit a TCA record that contains such a foreign_table_where on one of its columns or via an inline record configuration, results in an uncaught TYPO3 Exception.
Updated by Gerrit Code Review about 7 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54473
Updated by Wolfgang Klinger about 7 years ago
- Category set to Database API (Doctrine DBAL)
- Assignee set to Wolfgang Klinger
Updated by Gerrit Code Review about 7 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54473
Updated by Gerrit Code Review about 7 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54473
Updated by Gerrit Code Review about 7 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54473
Updated by Gerrit Code Review about 7 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54505
Updated by Wolfgang Klinger about 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f3e7a034c129aafc8b081e0125c50330207fae82.