Skip to content
Snippets Groups Projects
Verified Commit a9e79303 authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[BUGFIX] Prevent duplicate page renders on page not found ImmediateResponseExceptions

parent 7fe28c27
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,7 @@ use TYPO3\CMS\Core\Country\CountryProvider;
use TYPO3\CMS\Core\Error\Http\PageNotFoundException;
use TYPO3\CMS\Core\Exception\SiteNotFoundException;
use TYPO3\CMS\Core\Http\ImmediateResponseException;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Resource\Exception\AbstractFileOperationException;
use TYPO3\CMS\Core\Resource\Exception\ExistingTargetFileNameException;
use TYPO3\CMS\Core\Resource\Exception\ExistingTargetFolderException;
......@@ -304,6 +305,12 @@ class JoblistController extends ActionController {
$allJobsCount = $this->jobRepository->findJobsByFilter($filters)->count();
$numberOfPages = (int) ($jobLimit <= 0 ? 0 : \ceil($allJobsCount / $jobLimit));
if ($numberOfPages !== 0 && $currentPageBrowserPage >= $numberOfPages) {
/** @var PageRenderer $pageRenderer */
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
// the PageRenderer contains the content of the current request, the result of the following sub-request will
// be appended to it and we get 2 pages, the current one and the 404 page in one. We flush the PageRenderer
// content here, so it will contain only the 404 page content
$pageRenderer->setBodyContent('');
/** @var ErrorController $errorController */
$errorController = GeneralUtility::makeInstance(ErrorController::class);
$response = $errorController->pageNotFoundAction(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment