Bug #70293
closedMissing reference in "preprocessRequest" hook
0%
Description
Hi,
I think the hook "$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest']" should pass the reference of the calling object.
In \TYPO3\CMS\Frontend\Http\RequestHandler function handleRequest():
$hookParameters = array(); GeneralUtility::callUserFunction($hookFunction, $hookParameters, $hookParameters);
should be
$hookParameters = array(); GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
The same issue is in \TYPO3\CMS\Frontend\Http\EidRequestHandler function handleRequest().
It would be great if the hook parameters are not empty... since TYPO3 7.5 we can pass the "ServerRequestInterface $request". What do you think?
Markus
Updated by Benni Mack over 6 years ago
- Status changed from New to Closed
Hey Markus,
the reason why this isn't added is that the hook does not always have a TSFE object.
In TYPO3 v9 we now add PSR-15 based middlewares which are easier than hooks to implement, and you can play around with the PSR-7 request object directly, and even hand it further. See EXT:redirects for a nice example.