Skip to content

Instantly share code, notes, and snippets.

@oliverthiele
oliverthiele / ModelController.php
Created July 22, 2014 20:33
Debugging errors like "An error occurred while trying to call Vendor\ExtKey\Controller\ModelController->showAction() " in extbase extensions
/**
* A special action which is called if the originally intended action could
* not be called, for example if the arguments were not valid.
*
* The default implementation sets a flash message, request errors and forwards back
* to the originating action. This is suitable for most actions dealing with form input.
*
* We clear the page cache by default on an error as well, as we need to make sure the
* data is re-evaluated when the user changes something.
*
@einpraegsam
einpraegsam / NotAuthorized.php
Last active May 10, 2023 21:46
Individual 403 and 404 handling in TYPO3 9 and 10. Show a 404 page but keep wrong URL. In case of a missing frontend login, redirect to login page and redirect back after login.
<?php
declare(strict_types=1);
namespace Vendor\Sitepackage\PageHandler;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Error\PageErrorHandler\PageErrorHandlerInterface;
use TYPO3\CMS\Core\Http\RedirectResponse;
use TYPO3\CMS\Core\Http\Uri;
use TYPO3\CMS\Core\Site\Entity\Site;