Feature: #83740 - Cleanup of AbstractRecordList breaks hook¶
See forge#83740
Description¶
A new hook in Database
and Page
allows modify the current database query.
Register the hook via
- php:
$GLOBALS
['TYPO3_ CONF_ VARS'] ['SC_ OPTIONS'] [\ TYPO3\ CMS\ Recordlist\ Record List\ Database Record List:: class] ['modify Query'] - php:
$GLOBALS
['TYPO3_ CONF_ VARS'] ['SC_ OPTIONS'] [\ TYPO3\ CMS\ Backend\ View\ Page Layout View:: class] ['modify Query']
in the extensions ext_
file.
Example¶
An example implementation could look like this:
EXT:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class]['modifyQuery'][1313131313] =
\MyVendor\MySite\Hooks\DatabaseRecordListHook::class . '->modifyQuery';
Copied!
EXT:
namespace MyVendor\MySite\Hooks;
class DatabaseRecordListHook
{
public function modifyQuery(
array $parameters,
string $table,
int $pageId,
array $additionalConstraints,
array $fieldList,
\TYPO3\CMS\Core\Database\Query\QueryBuilder $queryBuilder
) {
// modify $queryBuilder
}
}
Copied!