|
|
@@ -6,17 +6,16 @@ use Opentalent\OtCore\Website\OtPageRepository;
|
|
|
use Opentalent\OtCore\Website\OtWebsiteRepository;
|
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
use Psr\Http\Message\ServerRequestInterface;
|
|
|
+use TYPO3\CMS\Core\Database\ConnectionPool;
|
|
|
+use TYPO3\CMS\Core\Domain\Repository\PageRepository;
|
|
|
use TYPO3\CMS\Core\Error\PageErrorHandler\PageContentErrorHandler;
|
|
|
use TYPO3\CMS\Core\Error\PageErrorHandler\PageErrorHandlerInterface;
|
|
|
use TYPO3\CMS\Core\Http\HtmlResponse;
|
|
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|
|
-use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext;
|
|
|
use TYPO3\CMS\Extbase\Mvc\Request;
|
|
|
-use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
|
|
|
-use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;
|
|
|
-use TYPO3\CMS\Extbase\Object\ObjectManager;
|
|
|
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
|
|
|
use TYPO3\CMS\Fluid\View\TemplateView;
|
|
|
+use TYPO3Fluid\Fluid\View\ViewInterface;
|
|
|
|
|
|
class ErrorHandler implements PageErrorHandlerInterface
|
|
|
{
|
|
|
@@ -46,7 +45,6 @@ class ErrorHandler implements PageErrorHandlerInterface
|
|
|
|
|
|
private OtWebsiteRepository $otWebsiteRepository;
|
|
|
private OtPageRepository $otPageRepository;
|
|
|
- private ControllerContext $controllerContext;
|
|
|
private RenderingContext $renderingContext;
|
|
|
private Request $request;
|
|
|
|
|
|
@@ -61,6 +59,20 @@ class ErrorHandler implements PageErrorHandlerInterface
|
|
|
$this->errorHandlerConfiguration = $configuration;
|
|
|
|
|
|
$this->view = GeneralUtility::makeInstance(TemplateView::class);
|
|
|
+
|
|
|
+ $this->otWebsiteRepository = GeneralUtility::makeInstance(OtWebsiteRepository::class);
|
|
|
+ $this->otPageRepository = GeneralUtility::makeInstance(OtPageRepository::class);
|
|
|
+
|
|
|
+ $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
|
|
|
+ $this->otWebsiteRepository->injectConnectionPool($connectionPool);
|
|
|
+
|
|
|
+ $pageRepository = GeneralUtility::makeInstance(PageRepository::class);
|
|
|
+ $this->otPageRepository->injectPageRepository($pageRepository);
|
|
|
+ $this->otPageRepository->injectConnectionPool($connectionPool);
|
|
|
+
|
|
|
+ $this->request = GeneralUtility::makeInstance(Request::class);
|
|
|
+
|
|
|
+ $this->renderingContext = GeneralUtility::makeInstance(RenderingContext::class);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -79,14 +91,6 @@ class ErrorHandler implements PageErrorHandlerInterface
|
|
|
$this->otPageRepository = $otPageRepository;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @param ControllerContext $controllerContext
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function injectControllerContext(ControllerContext $controllerContext) {
|
|
|
- $this->controllerContext = $controllerContext;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* @param RenderingContext $renderingContext
|
|
|
* @return void
|
|
|
@@ -115,8 +119,7 @@ class ErrorHandler implements PageErrorHandlerInterface
|
|
|
array $reasons = []
|
|
|
): ResponseInterface {
|
|
|
$this->request->setControllerExtensionName('ot_templating');
|
|
|
- $this->controllerContext->setRequest($this->request);
|
|
|
- $this->renderingContext->setControllerContext($this->controllerContext);
|
|
|
+ $this->renderingContext->setRequest($this->request);
|
|
|
|
|
|
$this->view->setRenderingContext($this->renderingContext);
|
|
|
$this->view->setTemplateRootPaths([self::TEMPLATES_ROOT_PATHS]);
|