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.
// That's not an error then return null; } throw new \LogicException('TypoScriptFrontendController was tried to be injected before initial creation', 1538370377); } public function getLanguage(): SiteLanguage {
*/ protected function getContentObjectRendererService() { $this->factories['TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer'] = function () { $instance = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class, \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getGlobalInstance(), $this); $instance->setLogger(($this->services['_early.TYPO3\\CMS\\Core\\Log\\LogManager'] ?? $this->get('_early.TYPO3\\CMS\\Core\\Log\\LogManager', 1))->getLogger('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer')); return $instance;
return $instance; }; return $this->factories['TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer'](); } /** * Gets the public 'TYPO3\CMS\Frontend\ContentObject\Menu\MenuContentObjectFactory' shared autowired service.
try { if (isset($this->fileMap[$id])) { return /* self::IGNORE_ON_UNINITIALIZED_REFERENCE */ 4 === $invalidBehavior ? null : $this->load($this->fileMap[$id]); } elseif (isset($this->methodMap[$id])) { return /* self::IGNORE_ON_UNINITIALIZED_REFERENCE */ 4 === $invalidBehavior ? null : $this->{$this->methodMap[$id]}(); } } catch (\Exception $e) { unset($this->services[$id]);
public function get(string $id, int $invalidBehavior = /* self::EXCEPTION_ON_INVALID_REFERENCE */ 1) { return $this->services[$id] ?? $this->services[$id = $this->aliases[$id] ?? $id] ?? ('service_container' === $id ? $this : ($this->factories[$id] ?? [$this, 'make'])($id, $invalidBehavior)); } /** * Creates a service.
// support classes that require dependency injection. // We operate on the original class name on purpose, as class overrides // are resolved inside the container if (self::$container !== null && $constructorArguments === [] && self::$container->has($className)) { return self::$container->get($className); } // Create new instance and call constructor with parameters $instance = new $finalClassName(...$constructorArguments);
*/ public function initializeObject(): void { $this->contentObject = $this->configurationManager->getContentObject() ?? GeneralUtility::makeInstance(ContentObjectRenderer::class); } /** * Sets the current request
*/ protected function initializeObject(object $instance): void { if (method_exists($instance, 'initializeObject') && is_callable([$instance, 'initializeObject'])) { $instance->initializeObject(); } } /**
$this->prototypeObjectsWhichAreCurrentlyInstanciated[$className] = true; } $instance = $this->instanciateObject($classSchema, ...$givenConstructorArguments); $this->injectDependencies($instance, $classSchema); $this->initializeObject($instance); if (!$classIsSingleton) { unset($this->prototypeObjectsWhichAreCurrentlyInstanciated[$className]); } return $instance;
*/ public function getInstance(string $className, array $givenConstructorArguments = []) { $this->prototypeObjectsWhichAreCurrentlyInstanciated = []; return $this->getInstanceInternal($className, ...$givenConstructorArguments); } /** * Create an instance of $className without calling its constructor
} trigger_error($objectName . ' is available in the PSR-11 container. That means you should not try to instanciate it using constructor arguments. Falling back to legacy extbase based injection.', E_USER_DEPRECATED); } return $this->objectContainer->getInstance($objectName, $constructorArguments); } /** * Create an instance of $className without calling its constructor
$request->setControllerExtensionName(ExtensionNamingUtility::getExtensionName($controllerExtensionKey)); $request->setControllerActionName($this->getControllerActionFromRecord($row)); $request->setControllerName($this->getControllerNameFromRecord($row)); /** @var UriBuilder $uriBuilder */ $uriBuilder = $objectManager->get(UriBuilder::class); $uriBuilder->setRequest($request); /** @var ControllerContext $controllerContext */ $controllerContext = $objectManager->get(ControllerContext::class); $controllerContext->setRequest($request);
return $fromCache; } $configurationSectionName = $this->getConfigurationSectionName($row); $viewVariables = $this->getViewVariables($row); $view = $this->getViewForRecord($row); try { if ($configurationSectionName) { $view->renderSection($configurationSectionName, $viewVariables, false);
public function getForm(array $row) { $form = $this->form ?? $this->createCustomFormInstance($row) ?? $this->extractConfiguration($row, 'form') ?? Form::create(); $form->setOption(Form::OPTION_RECORD, $row); return $form; }
$form = $cache->get($cacheId); if (!$form) { // Provider *must* be able to return a Form without any global configuration or specific content // record being passed to it. We test this now to fail early if any errors happen during Form fetching. $form = $provider->getForm(['CType' => $contentType]); if (!$form) { return; } try {
Core::registerConfigurationProvider($provider); $pluginName = $pluginName ?: GeneralUtility::underscoredToUpperCamelCase(end(explode('_', $contentType, 2))); $contentTypeBuilder->registerContentType($providerExtensionName, $contentType, $provider, $pluginName); } catch (Exception $error) { if (!ContextUtility::getApplicationContext()->isProduction()) { throw $error; }
} } $this->spoolQueuedContentTypeRegistrations(Core::getQueuedContentTypeRegistrations()); Core::clearQueuedContentTypeRegistrations(); } /**
{ $property = new \ReflectionProperty($caller, 'extensionStaticsProcessed'); $property->setAccessible(true); if (!$property->getValue($caller)) { $this->processData(); } } /**
$methodName = (string)$parts[1]; $callable = [$classObj, $methodName]; if (is_callable($callable)) { // Call method: $content = call_user_func_array($callable, [&$params, &$ref]); } else { $errorMsg = 'No method name \'' . $parts[1] . '\' in class ' . $parts[0]; throw new \InvalidArgumentException($errorMsg, 1294585865); }
'pid' => &$pid, 'row' => &$row ]; foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSources'] ?? [] as $_funcRef) { GeneralUtility::callUserFunction($_funcRef, $_params, $this); } // If "Include before all static templates if root-flag is set" is set: $staticFileMode = $row['static_file_mode'] ?? null; if ($staticFileMode == 3 && strpos($templateID, 'sys_') === 0 && $row['root']) {
} // Include files (from extensions) (#1/2) // NORMAL inclusion, The EXACT same code is found below the basedOn inclusion!!! if (!isset($row['includeStaticAfterBasedOn']) || !$row['includeStaticAfterBasedOn']) { $this->includeStaticTypoScriptSources($idList, $templateID, $pid, $row); } // Include "Based On" sys_templates: // 'basedOn' is a list of templates to include if (trim($row['basedOn'] ?? '')) {
->execute(); if ($row = $queryResult->fetch()) { $this->versionOL($row); if (is_array($row)) { $this->processTemplate($row, 'sys_' . $row['uid'], $this->absoluteRootLine[$a]['uid'], 'sys_' . $row['uid']); } } $this->rootLine[] = $this->absoluteRootLine[$a]; }
// could be used (this is the case if $TSFE->all is set, and the // rowSum still matches). Based on this we decide if cache_pagesection // needs to be updated... $isCached = false; $this->runThroughTemplates($theRootLine); if ($this->getTypoScriptFrontendController()->all) { $cc = $this->getTypoScriptFrontendController()->all; // The two rowSums must NOT be different from each other - which they will be if start/endtime or hidden has changed! if (serialize($this->rowSum) !== serialize($cc['rowSum'])) {
if (empty($this->config) || $this->isINTincScript() || $this->context->getPropertyFromAspect('typoscript', 'forcedTemplateParsing')) { $timeTracker = $this->getTimeTracker(); $timeTracker->push('Parse template'); // Start parsing the TS template. Might return cached version. $this->tmpl->start($this->rootLine); $timeTracker->pull(); // At this point we have a valid pagesection_cache (generated in $this->tmpl->start()), // so let all other processes proceed now. (They are blocked at the pagessection_lock in getFromCache()) $this->releaseLock('pagesection');
); $controller->fe_user = $frontendUserAuthentication; $controller->fetch_the_id(); $controller->calculateLinkVars($queryParams); $controller->getConfigArray(); $controller->settingLanguage(); $controller->newCObj(); if (!$GLOBALS['TSFE'] instanceof TypoScriptFrontendController) { $GLOBALS['TSFE'] = $controller;
{ if (!isset($linkDetails['type'], $GLOBALS['TYPO3_CONF_VARS']['FE']['typolinkBuilder'][$linkDetails['type']])) { return null; } $controller = $this->bootFrontendController($frontendUserAuthentication, $site, $queryParams); /** @var AbstractTypolinkBuilder $linkBuilder */ $linkBuilder = GeneralUtility::makeInstance( $GLOBALS['TYPO3_CONF_VARS']['FE']['typolinkBuilder'][$linkDetails['type']], $controller->cObj,
if (($site === null || $site instanceof NullSite) && $linkDetails['type'] === 'page') { $site = $this->siteFinder->getSiteByPageId((int)$linkDetails['pageuid']); } // If it's a record or page, then boot up TSFE and use typolink return $this->getUriFromCustomLinkDetails($matchedRedirect, $frontendUserAuthentication, $site, $linkDetails, $queryParams); } /** * Adds query parameters to a Uri object
); // If the matched redirect is found, resolve it, and check further if (is_array($matchedRedirect)) { $url = $this->redirectService->getTargetUrl($matchedRedirect, $request->getQueryParams(), $request->getAttribute('frontend.user'), $request->getUri(), $request->getAttribute('site')); if ($url instanceof UriInterface) { $this->logger->debug('Redirecting', ['record' => $matchedRedirect, 'uri' => $url]); $response = $this->buildRedirectResponse($url, $matchedRedirect); $this->incrementHitCount($matchedRedirect);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// Register the frontend user as aspect and within the session $this->setFrontendUserAspect($frontendUser); $request = $request->withAttribute('frontend.user', $frontendUser); $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); } }; } }
Bootstrap::loadExtTables(); $this->setBackendUserAspect($GLOBALS['BE_USER']); } $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); } }; } }
) { 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); } }; } }
$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); } }; } }
* @return ResponseInterface */ public function handle(ServerRequestInterface $request): ResponseInterface { return $this->tip->handle($request); } /** * Seed the middleware stack with the inner request handler
* @return ResponseInterface */ protected function handle(ServerRequestInterface $request): ResponseInterface { return $this->requestHandler->handle($request); } /** * Set up the application and shut it down afterwards
// 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); } /** * Check if LocalConfiguration.php and PackageStates.php exist
final public function run(callable $execute = null) { try { $response = $this->handle( ServerRequestFactory::fromGlobals() ); if ($execute !== null) { call_user_func($execute); }
// Set up the application for the frontend call_user_func(function () { $classLoader = require dirname(__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(function () { $classLoader = require dirname(__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(); });