Actions
Bug #90607
closedUseless $parameters variable in "modifyQuery" hooks
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2020-03-01
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
The following classes use the new "modifyQuery" hooks since TYPO3 9.4:
Which makes the $parameters array for both of these hooks completely useless and misleading.
- \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList
uses $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][DatabaseRecordList::class]['modifyQuery']
- \TYPO3\CMS\Backend\View\PageLayoutView
- \TYPO3\CMS\Backend\View\BackendLayout\ContentFetcher (new Replacement for PageLayoutView)
use $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][PageLayoutView::class]['modifyQuery']
All of these hooks use a $parameters argument, which is never used at all.
The one in DatabaseRecordList holds the following values:
$parameters = [
'table' => $table,
'fields' => $fieldList,
'groupBy' => null,
'orderBy' => null,
'firstResult' => $this->firstElementNumber ?: null,
'maxResults' => $this->iLimit ?: null
];
$table and $fieldList are already assigned as separate arguments to modifyQuery(). Only the 'firstResult' and 'maxResults' are actually useful in the hook as information.
But in both the hooks for PageLayoutView and ContentFetcher $parameters only holds this information:
$parameters = [
'table' => $table,
'fields' => $fields,
'groupBy' => null,
'orderBy' => null
];
Which makes the $parameters array for both of these hooks completely useless and misleading.
Actions