If you need help solving this exception, you can have a look at the TYPO3 Documentation. There you can find solutions provided by the TYPO3 community. Once you have found a solution to the problem, help others by contributing to the documentation page.
Find a solution for this exception in the TYPO3 Documentation.
return $result; } catch (TargetNotFoundException $e) { throw $e; } catch (\Exception $e) { throw new Exception('Exception while property mapping at property path "' . implode('.', $currentPropertyPath) . '": ' . $e->getMessage(), 1297759968, $e); } } /**
} $this->propertyMapper->resetMessages(); try { $argument->setValue( $this->propertyMapper->convert( $rawValue, $dataType, $argument->getPropertyMappingConfiguration() )
/** @var Argument $argument */ foreach ($this->arguments as $argument) { $argumentName = $argument->getName(); if ($this->request->hasArgument($argumentName)) { $this->setArgumentValue($argument, $this->request->getArgument($argumentName)); } elseif ($argument->isRequired()) { throw new RequiredArgumentMissingException('Required argument "' . $argumentName . '" is not set for ' . $this->request->getControllerObjectName() . '->' . $this->request->getControllerActionName() . '.', 1298012500); } }
$callable = [$this, $actionInitializationMethodName]; if (is_callable($callable)) { $callable(); } $this->mapRequestArgumentsToControllerArguments(); $this->view = $this->resolveView(); if ($this->view !== null && method_exists($this, 'initializeView')) { $this->initializeView($this->view); }
1217839467 ); } $controller = $this->resolveController($request); $response = $controller->processRequest($request); if ($response instanceof ForwardResponse) { // The controller action returned an extbase internal Forward response: // Another action should be dispatched. $request = static::buildRequestFromCurrentRequestAndForwardResponse($request, $response);
} } // Dispatch the extbase request $response = $this->dispatcher->dispatch($extbaseRequest); if ($response->getStatusCode() >= 300) { // Avoid caching the plugin when we issue a redirect or error response // This means that even when an action is configured as cachable // we avoid the plugin to be cached, but keep the page cache untouched
// Come here only if we are not called from $TSFE->processNonCacheableContentPartsAndSubstituteContentMarkers()! $this->cObj->setUserObjectType(ContentObjectRenderer::OBJECTTYPE_USER); } $request = $extbaseBootstrap->initialize($conf, $this->request); $content = $extbaseBootstrap->handleFrontendRequest($request); // Rendering is deferred, as the action should not be cached, we pump this now to TSFE to be executed later-on if ($this->cObj->doConvertToUserIntObject) { $this->cObj->doConvertToUserIntObject = false; // @todo: this should be removed in the future in TSFE to allow more "uncacheables" than USER_INTs
} // Render content try { $content .= $contentObject->render($configuration); } catch (ContentRenderingException $exception) { // Content rendering Exceptions indicate a critical problem which should not be // caught e.g. when something went wrong with Exception handling itself throw $exception;
$fullConfigArray = $this->mergeTSRef($fullConfigArray, 'tempKey'); $contentObject = $this->getContentObject($fullConfigArray['tempKey']); $content = ''; if ($contentObject) { $content = $this->render($contentObject, $fullConfigArray['tempKey.']); } if ($timeTracker->LR) { $timeTracker->pull($content); }
foreach ($sKeyArray as $theKey) { $theValue = $setup[$theKey]; if ((int)$theKey && !str_contains($theKey, '.')) { $conf = $setup[$theKey . '.'] ?? []; $contentObjects[] = $this->cObjGetSingle($theValue, $conf, $addKey . $theKey); } } return $contentObjects; }
{ if (!is_array($setup)) { return ''; } return implode('', $this->cObjGetSeparated($setup, $addKey)); } /** * Rendering of a "numerical array" of cObjects from TypoScript
* in the content that is processed later-on. */ protected function generatePageBodyContent(TypoScriptFrontendController $controller): string { $pageContent = $controller->cObj->cObjGet($controller->pSetup) ?: ''; if ($controller->pSetup['wrap'] ?? false) { $pageContent = $controller->cObj->wrap($pageContent, $controller->pSetup['wrap']); } if ($controller->pSetup['stdWrap.'] ?? false) {
protected function generatePageContent(TypoScriptFrontendController $controller, ServerRequestInterface $request): string { // Generate the main content between the <body> tags // This has to be done first, as some additional TSFE-related code could have been written $pageContent = $this->generatePageBodyContent($controller); // If 'disableAllHeaderCode' is set, all the pageRenderer settings are not evaluated if ($controller->config['config']['disableAllHeaderCode'] ?? false) { return $pageContent; }
// Content generation $this->timeTracker->incStackPointer(); $this->timeTracker->push('Page generation PAGE object'); $controller->content = $this->generatePageContent($controller, $request); $this->timeTracker->pull($this->timeTracker->LR ? $controller->content : ''); $this->timeTracker->decStackPointer();
{ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { try { $response = $handler->handle($request); } catch (PropagateResponseException $e) { $response = $e->getResponse(); }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { // return early in case CSP shall not be used if (!$this->features->isFeatureEnabled('security.frontend.enforceContentSecurityPolicy')) { return $handler->handle($request); } // make sure, the nonce value is set before processing the remaining middlewares $request = $request->withAttribute('nonce', $this->requestId->nonce); $response = $handler->handle($request);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// Throw away all output that may have happened during bootstrapping by weird extensions ob_clean(); // Initialize output compression if configured $this->initializeOutputCompression(); return $handler->handle($request); } /** * Initialize output compression if configured
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* Render the admin panel if activated */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); if ( $GLOBALS['TSFE'] instanceof TypoScriptFrontendController && StateUtility::isActivatedForUser() && StateUtility::isActivatedInTypoScript()
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* Render the admin panel if activated */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); if ( $GLOBALS['TSFE'] instanceof TypoScriptFrontendController && StateUtility::isActivatedForUser() && StateUtility::isActivatedInTypoScript()
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* Adds the content length */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); if ($GLOBALS['TSFE'] instanceof TypoScriptFrontendController) { $context = $GLOBALS['TSFE']->getContext(); if ( (!isset($GLOBALS['TSFE']->config['config']['enableContentLengthHeader']) || $GLOBALS['TSFE']->config['config']['enableContentLengthHeader'])
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
class AssetInclusion implements MiddlewareInterface { public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); $body = $response->getBody(); $body->rewind(); $contents = $body->getContents();
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$controller->getPageAccessFailureReasons(PageAccessFailureReasons::INVALID_EXTERNAL_URL) ); } return $handler->handle($request); } protected function getRedirectUri(ServerRequestInterface $request): ?string {
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// Set new request which now has the frontend.typoscript attribute $GLOBALS['TYPO3_REQUEST'] = $request; $response = $handler->handle($request); /** * Release TSFE locks. They have been acquired in the above call to controller->getFromCache(). * TSFE locks are usually released by the RequestHandler 'final' middleware.
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// Make TSFE globally available // @todo deprecate $GLOBALS['TSFE'] once TSFE is retrieved from the // PSR-7 request attribute frontend.controller throughout TYPO3 core $GLOBALS['TSFE'] = $controller; return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
if (YoastRequestHash::isValid($request->getServerParams())) { $context = GeneralUtility::makeInstance(Context::class); $context->setAspect('visibility', new VisibilityAspect(true)); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$this->context->setAspect('visibility', $newAspect); } } return $handler->handle($request); } protected function checkIfRootlineRequiresPreview(int $pageId): bool {
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
break; } } } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$pageArguments = $request->getAttribute('routing', null); if ($pageArguments instanceof PageArguments && $GLOBALS['BE_USER'] instanceof PreviewUserAuthentication) { $GLOBALS['BE_USER']->setWebmounts([$pageArguments->getPageId()]); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
} } $request = $request->withAttribute('noCache', $this->disableCache); return $handler->handle($request); } /** * Filters out the arguments that are necessary for calculating cHash
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// merge the PageArguments with the request query parameters $queryParams = array_replace_recursive($request->getQueryParams(), $pageArguments->getArguments()); $request = $request->withQueryParams($queryParams); return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$addInformationAboutDisabledCache = true; $setCookieOnCurrentRequest = false; } $response = $handler->handle($request); $tsfe = $this->getTypoScriptFrontendController(); if ($tsfe !== null && $addInformationAboutDisabledCache) { $tsfe->set_no_cache('GET Parameter ADMCMD_prev=LIVE was given', true);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
return new HtmlResponse($content, 200, ['Content-Type' => $contentType]); } } return $handler->handle($request); } /** * Find the proper configuration for the static route in the static route configuration. Mainly:
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
MainController::class ); $request = $adminPanelController->initialize($request); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// @todo create report, then call persist, then dispatch new event $this->persistCspReport($scope, $request); return new NullResponse(); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$uri = $requestedUri->withPath(rtrim($requestedUri->getPath(), '/')); return new RedirectResponse($uri, 307); } } return $handler->handle($request); } /** * Checks if the language is allowed in Frontend, if not, check if there is valid BE user
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
); // If the matched redirect is found, resolve it, and check further if (!is_array($matchedRedirect)) { return $handler->handle($request); } $url = $this->redirectService->getTargetUrl($matchedRedirect, $request); if ($url === null) { return $handler->handle($request);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
if ($this->context->getAspect('frontend.user')->isLoggedIn() && $rateLimiter) { $rateLimiter->reset(); } $response = $handler->handle($request); // Store session data for fe_users if it still exists if ($frontendUser instanceof FrontendUserAuthentication) { $frontendUser->storeSessionData();
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$request = $request->withAttribute('noCache', true); } } $response = $handler->handle($request); // If, when building the response, the user is still available, then ensure that the headers are sent properly if ($this->context->getAspect('backend.user')->isLoggedIn()) { return $this->applyHeadersToResponse($response);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$this->securityAspect->setReceivedRequestToken(false); $this->logger->debug('Could not resolve request token', ['exception' => $exception]); } $response = $handler->handle($request); return $this->enrichResponseWithCookie($request, $response); } protected function resolveNoncePool(ServerRequestInterface $request): NoncePool
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
) { return GeneralUtility::makeInstance(ErrorController::class)->unavailableAction($request, 'This page is temporarily unavailable.'); } // Continue the regular stack if no maintenance mode is active return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$request = $request->withAttribute('routing', $routeResult); if ($routeResult->getLanguage() instanceof SiteLanguage) { Locales::setSystemLocaleFromSiteLanguage($routeResult->getLanguage()); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
{ $eID = $request->getParsedBody()['eID'] ?? $request->getQueryParams()['eID'] ?? null; if ($eID === null) { return $handler->handle($request); } // Remove any output produced until now ob_clean();
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
*/ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $request = $request->withAttribute('normalizedParams', NormalizedParams::createFromRequest($request)); return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
{ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $GLOBALS['TYPO3_REQUEST'] = $GLOBALS['TYPO3_REQUEST'] ?? $request; return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
{ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $GLOBALS['TYPO3_REQUEST'] = $GLOBALS['TYPO3_REQUEST'] ?? $request; return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
1396795884 ); } return $handler->handle($request); } /** * Checks if the provided host header value matches the trusted hosts pattern.
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$this->timeTracker->setEnabled($timeTrackingEnabled); $this->timeTracker->start(microtime(true)); $this->timeTracker->push(''); $response = $handler->handle($request); // Finish time tracking $this->timeTracker->pull(); $this->timeTracker->finish();
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* Invoke the middleware stack */ public function handle(ServerRequestInterface $request): ResponseInterface { return $this->tip->handle($request); } /** * Seed the middleware stack with the inner request handler
public function handle(ServerRequestInterface $request): ResponseInterface { try { $response = $this->requestHandler->handle($request); } catch (ImmediateResponseException $exception) { $response = $exception->getResponse(); } return $response;
// Create new request object having applicationType "I am a frontend request" attribute. $request = $request->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE); $this->initializeContext(); return parent::handle($request); } /** * Create a PSR-7 Response that redirects to the install tool
* Set up the application and shut it down afterwards */ final public function run() { $response = $this->handle(ServerRequestFactory::fromGlobals()); $this->sendResponse($response); } }
// Set up the application for the frontend call_user_func(static function () { $classLoader = require __DIR__.'/vendor/autoload.php'; \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_FE); \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Frontend\Http\Application::class)->run(); });
call_user_func(static function () { $classLoader = require __DIR__.'/vendor/autoload.php'; \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_FE); \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Frontend\Http\Application::class)->run(); });
{ if (ctype_digit((string)$identity)) { $object = $this->persistenceManager->getObjectByIdentifier($identity, $targetType); } else { throw new InvalidSourceException('The identity property "' . $identity . '" is no UID.', 1297931020); } if ($object === null) { throw new TargetNotFoundException(sprintf('Object of type %s with identity "%s" not found.', $targetType, print_r($identity, true)), 1297933823);
} elseif (is_string($source) || is_int($source)) { if (empty($source)) { return null; } $object = $this->fetchObjectFromPersistence($source, $targetType); } else { // todo: this case is impossible as this converter is never called with a source that is not an integer, a string or an array throw new \InvalidArgumentException('Only integers, strings and arrays are accepted.', 1305630314); }
if (!($targetPropertyValue instanceof Error)) { $convertedChildProperties[$targetPropertyName] = $targetPropertyValue; } } $result = $typeConverter->convertFrom($source, $targetType, $convertedChildProperties, $configuration); if ($result instanceof Error) { $this->messages->forProperty(implode('.', $currentPropertyPath))->addError($result); }
{ $configuration ??= $this->configurationBuilder->build(); $currentPropertyPath = []; try { $result = $this->doMapping($source, $targetType, $configuration, $currentPropertyPath); if ($result instanceof Error) { return null; }
} $this->propertyMapper->resetMessages(); try { $argument->setValue( $this->propertyMapper->convert( $rawValue, $dataType, $argument->getPropertyMappingConfiguration() )
/** @var Argument $argument */ foreach ($this->arguments as $argument) { $argumentName = $argument->getName(); if ($this->request->hasArgument($argumentName)) { $this->setArgumentValue($argument, $this->request->getArgument($argumentName)); } elseif ($argument->isRequired()) { throw new RequiredArgumentMissingException('Required argument "' . $argumentName . '" is not set for ' . $this->request->getControllerObjectName() . '->' . $this->request->getControllerActionName() . '.', 1298012500); } }
$callable = [$this, $actionInitializationMethodName]; if (is_callable($callable)) { $callable(); } $this->mapRequestArgumentsToControllerArguments(); $this->view = $this->resolveView(); if ($this->view !== null && method_exists($this, 'initializeView')) { $this->initializeView($this->view); }
1217839467 ); } $controller = $this->resolveController($request); $response = $controller->processRequest($request); if ($response instanceof ForwardResponse) { // The controller action returned an extbase internal Forward response: // Another action should be dispatched. $request = static::buildRequestFromCurrentRequestAndForwardResponse($request, $response);
} } // Dispatch the extbase request $response = $this->dispatcher->dispatch($extbaseRequest); if ($response->getStatusCode() >= 300) { // Avoid caching the plugin when we issue a redirect or error response // This means that even when an action is configured as cachable // we avoid the plugin to be cached, but keep the page cache untouched
// Come here only if we are not called from $TSFE->processNonCacheableContentPartsAndSubstituteContentMarkers()! $this->cObj->setUserObjectType(ContentObjectRenderer::OBJECTTYPE_USER); } $request = $extbaseBootstrap->initialize($conf, $this->request); $content = $extbaseBootstrap->handleFrontendRequest($request); // Rendering is deferred, as the action should not be cached, we pump this now to TSFE to be executed later-on if ($this->cObj->doConvertToUserIntObject) { $this->cObj->doConvertToUserIntObject = false; // @todo: this should be removed in the future in TSFE to allow more "uncacheables" than USER_INTs
} // Render content try { $content .= $contentObject->render($configuration); } catch (ContentRenderingException $exception) { // Content rendering Exceptions indicate a critical problem which should not be // caught e.g. when something went wrong with Exception handling itself throw $exception;
$fullConfigArray = $this->mergeTSRef($fullConfigArray, 'tempKey'); $contentObject = $this->getContentObject($fullConfigArray['tempKey']); $content = ''; if ($contentObject) { $content = $this->render($contentObject, $fullConfigArray['tempKey.']); } if ($timeTracker->LR) { $timeTracker->pull($content); }
foreach ($sKeyArray as $theKey) { $theValue = $setup[$theKey]; if ((int)$theKey && !str_contains($theKey, '.')) { $conf = $setup[$theKey . '.'] ?? []; $contentObjects[] = $this->cObjGetSingle($theValue, $conf, $addKey . $theKey); } } return $contentObjects; }
{ if (!is_array($setup)) { return ''; } return implode('', $this->cObjGetSeparated($setup, $addKey)); } /** * Rendering of a "numerical array" of cObjects from TypoScript
* in the content that is processed later-on. */ protected function generatePageBodyContent(TypoScriptFrontendController $controller): string { $pageContent = $controller->cObj->cObjGet($controller->pSetup) ?: ''; if ($controller->pSetup['wrap'] ?? false) { $pageContent = $controller->cObj->wrap($pageContent, $controller->pSetup['wrap']); } if ($controller->pSetup['stdWrap.'] ?? false) {
protected function generatePageContent(TypoScriptFrontendController $controller, ServerRequestInterface $request): string { // Generate the main content between the <body> tags // This has to be done first, as some additional TSFE-related code could have been written $pageContent = $this->generatePageBodyContent($controller); // If 'disableAllHeaderCode' is set, all the pageRenderer settings are not evaluated if ($controller->config['config']['disableAllHeaderCode'] ?? false) { return $pageContent; }
// Content generation $this->timeTracker->incStackPointer(); $this->timeTracker->push('Page generation PAGE object'); $controller->content = $this->generatePageContent($controller, $request); $this->timeTracker->pull($this->timeTracker->LR ? $controller->content : ''); $this->timeTracker->decStackPointer();
{ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { try { $response = $handler->handle($request); } catch (PropagateResponseException $e) { $response = $e->getResponse(); }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { // return early in case CSP shall not be used if (!$this->features->isFeatureEnabled('security.frontend.enforceContentSecurityPolicy')) { return $handler->handle($request); } // make sure, the nonce value is set before processing the remaining middlewares $request = $request->withAttribute('nonce', $this->requestId->nonce); $response = $handler->handle($request);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// Throw away all output that may have happened during bootstrapping by weird extensions ob_clean(); // Initialize output compression if configured $this->initializeOutputCompression(); return $handler->handle($request); } /** * Initialize output compression if configured
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* Render the admin panel if activated */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); if ( $GLOBALS['TSFE'] instanceof TypoScriptFrontendController && StateUtility::isActivatedForUser() && StateUtility::isActivatedInTypoScript()
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* Render the admin panel if activated */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); if ( $GLOBALS['TSFE'] instanceof TypoScriptFrontendController && StateUtility::isActivatedForUser() && StateUtility::isActivatedInTypoScript()
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* Adds the content length */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); if ($GLOBALS['TSFE'] instanceof TypoScriptFrontendController) { $context = $GLOBALS['TSFE']->getContext(); if ( (!isset($GLOBALS['TSFE']->config['config']['enableContentLengthHeader']) || $GLOBALS['TSFE']->config['config']['enableContentLengthHeader'])
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
class AssetInclusion implements MiddlewareInterface { public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); $body = $response->getBody(); $body->rewind(); $contents = $body->getContents();
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$controller->getPageAccessFailureReasons(PageAccessFailureReasons::INVALID_EXTERNAL_URL) ); } return $handler->handle($request); } protected function getRedirectUri(ServerRequestInterface $request): ?string {
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// Set new request which now has the frontend.typoscript attribute $GLOBALS['TYPO3_REQUEST'] = $request; $response = $handler->handle($request); /** * Release TSFE locks. They have been acquired in the above call to controller->getFromCache(). * TSFE locks are usually released by the RequestHandler 'final' middleware.
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// Make TSFE globally available // @todo deprecate $GLOBALS['TSFE'] once TSFE is retrieved from the // PSR-7 request attribute frontend.controller throughout TYPO3 core $GLOBALS['TSFE'] = $controller; return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
if (YoastRequestHash::isValid($request->getServerParams())) { $context = GeneralUtility::makeInstance(Context::class); $context->setAspect('visibility', new VisibilityAspect(true)); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$this->context->setAspect('visibility', $newAspect); } } return $handler->handle($request); } protected function checkIfRootlineRequiresPreview(int $pageId): bool {
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
break; } } } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$pageArguments = $request->getAttribute('routing', null); if ($pageArguments instanceof PageArguments && $GLOBALS['BE_USER'] instanceof PreviewUserAuthentication) { $GLOBALS['BE_USER']->setWebmounts([$pageArguments->getPageId()]); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
} } $request = $request->withAttribute('noCache', $this->disableCache); return $handler->handle($request); } /** * Filters out the arguments that are necessary for calculating cHash
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// merge the PageArguments with the request query parameters $queryParams = array_replace_recursive($request->getQueryParams(), $pageArguments->getArguments()); $request = $request->withQueryParams($queryParams); return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$addInformationAboutDisabledCache = true; $setCookieOnCurrentRequest = false; } $response = $handler->handle($request); $tsfe = $this->getTypoScriptFrontendController(); if ($tsfe !== null && $addInformationAboutDisabledCache) { $tsfe->set_no_cache('GET Parameter ADMCMD_prev=LIVE was given', true);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
return new HtmlResponse($content, 200, ['Content-Type' => $contentType]); } } return $handler->handle($request); } /** * Find the proper configuration for the static route in the static route configuration. Mainly:
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
MainController::class ); $request = $adminPanelController->initialize($request); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// @todo create report, then call persist, then dispatch new event $this->persistCspReport($scope, $request); return new NullResponse(); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$uri = $requestedUri->withPath(rtrim($requestedUri->getPath(), '/')); return new RedirectResponse($uri, 307); } } return $handler->handle($request); } /** * Checks if the language is allowed in Frontend, if not, check if there is valid BE user
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
); // If the matched redirect is found, resolve it, and check further if (!is_array($matchedRedirect)) { return $handler->handle($request); } $url = $this->redirectService->getTargetUrl($matchedRedirect, $request); if ($url === null) { return $handler->handle($request);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
if ($this->context->getAspect('frontend.user')->isLoggedIn() && $rateLimiter) { $rateLimiter->reset(); } $response = $handler->handle($request); // Store session data for fe_users if it still exists if ($frontendUser instanceof FrontendUserAuthentication) { $frontendUser->storeSessionData();
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$request = $request->withAttribute('noCache', true); } } $response = $handler->handle($request); // If, when building the response, the user is still available, then ensure that the headers are sent properly if ($this->context->getAspect('backend.user')->isLoggedIn()) { return $this->applyHeadersToResponse($response);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$this->securityAspect->setReceivedRequestToken(false); $this->logger->debug('Could not resolve request token', ['exception' => $exception]); } $response = $handler->handle($request); return $this->enrichResponseWithCookie($request, $response); } protected function resolveNoncePool(ServerRequestInterface $request): NoncePool
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
) { return GeneralUtility::makeInstance(ErrorController::class)->unavailableAction($request, 'This page is temporarily unavailable.'); } // Continue the regular stack if no maintenance mode is active return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$request = $request->withAttribute('routing', $routeResult); if ($routeResult->getLanguage() instanceof SiteLanguage) { Locales::setSystemLocaleFromSiteLanguage($routeResult->getLanguage()); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
{ $eID = $request->getParsedBody()['eID'] ?? $request->getQueryParams()['eID'] ?? null; if ($eID === null) { return $handler->handle($request); } // Remove any output produced until now ob_clean();
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
*/ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $request = $request->withAttribute('normalizedParams', NormalizedParams::createFromRequest($request)); return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
{ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $GLOBALS['TYPO3_REQUEST'] = $GLOBALS['TYPO3_REQUEST'] ?? $request; return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
{ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $GLOBALS['TYPO3_REQUEST'] = $GLOBALS['TYPO3_REQUEST'] ?? $request; return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
1396795884 ); } return $handler->handle($request); } /** * Checks if the provided host header value matches the trusted hosts pattern.
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$this->timeTracker->setEnabled($timeTrackingEnabled); $this->timeTracker->start(microtime(true)); $this->timeTracker->push(''); $response = $handler->handle($request); // Finish time tracking $this->timeTracker->pull(); $this->timeTracker->finish();
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* Invoke the middleware stack */ public function handle(ServerRequestInterface $request): ResponseInterface { return $this->tip->handle($request); } /** * Seed the middleware stack with the inner request handler
public function handle(ServerRequestInterface $request): ResponseInterface { try { $response = $this->requestHandler->handle($request); } catch (ImmediateResponseException $exception) { $response = $exception->getResponse(); } return $response;
// Create new request object having applicationType "I am a frontend request" attribute. $request = $request->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE); $this->initializeContext(); return parent::handle($request); } /** * Create a PSR-7 Response that redirects to the install tool
* Set up the application and shut it down afterwards */ final public function run() { $response = $this->handle(ServerRequestFactory::fromGlobals()); $this->sendResponse($response); } }
// Set up the application for the frontend call_user_func(static function () { $classLoader = require __DIR__.'/vendor/autoload.php'; \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_FE); \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Frontend\Http\Application::class)->run(); });
call_user_func(static function () { $classLoader = require __DIR__.'/vendor/autoload.php'; \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_FE); \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Frontend\Http\Application::class)->run(); });