use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface as PsrRequestHandlerInterface;
+use TYPO3\CMS\Core\Routing\PageArguments;
use TYPO3\CMS\Core\TimeTracker\TimeTracker;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
// Merge Query Parameters with config.defaultGetVars
// This is done in getConfigArray as well, but does not override the current middleware request object
// Since we want to stay in sync with this, the option needs to be set as well.
+ $pageArguments = $request->getAttribute('routing');
if (!empty($this->controller->config['config']['defaultGetVars.'] ?? null)) {
$modifiedGetVars = GeneralUtility::removeDotsFromTS($this->controller->config['config']['defaultGetVars.']);
+ if ($pageArguments instanceof PageArguments) {
+ $pageArguments = $pageArguments->withQueryArguments($modifiedGetVars);
+ $this->controller->setPageArguments($pageArguments);
+ $request = $request->withAttribute('routing', $pageArguments);
+ }
if (!empty($request->getQueryParams())) {
ArrayUtility::mergeRecursiveWithOverrule($modifiedGetVars, $request->getQueryParams());
}
// @deprecated since TYPO3 v9.3, will be removed in TYPO3 v10.0
$this->controller->initializeRedirectUrlHandlers(true);
-
- // Hook for processing data submission to extensions
- // This is done at this point, because we need the config values
- if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission'])) {
- trigger_error('The "checkDataSubmission" hook will be removed in TYPO3 v10.0 in favor of PSR-15. Use a middleware instead.', E_USER_DEPRECATED);
- foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission'] as $className) {
- GeneralUtility::makeInstance($className)->checkDataSubmission($this->controller);
- }
- }
-
return $handler->handle($request);
}