+
+ // 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());
+ }
+ $request = $request->withQueryParams($modifiedGetVars);
+ $GLOBALS['TYPO3_REQUEST'] = $request;
+ }
+