Last active
June 8, 2016 09:57
-
-
Save rcerrejon/214fbaf8f368ae157aa4 to your computer and use it in GitHub Desktop.
Debug: "An error occurred while trying to call Vendor\ExtKey\Controller\ModelController->showAction()"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function errorAction() { | |
echo 'ErrorAction'; | |
$this->clearCacheOnError(); | |
if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) { | |
echo 'Rewritten Property Mapper'; | |
echo '<pre>'; | |
foreach ($this->arguments->getValidationResults()->getFlattenedErrors() as $propertyPath => $errors) { | |
foreach ($errors as $error) { | |
$message .= 'Error for ' . $propertyPath . ': ' . $error->render() . | |
PHP_EOL; | |
} | |
echo 'Error: ' . $message; | |
} | |
echo '</pre>'; | |
$errorFlashMessage = $this->getErrorFlashMessage(); | |
if ($errorFlashMessage !== FALSE) { | |
$errorFlashMessageObject = new \TYPO3\CMS\Core\Messaging\FlashMessage( | |
$errorFlashMessage, | |
'', | |
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR | |
); | |
$this->controllerContext->getFlashMessageQueue()->enqueue($errorFlashMessageObject); | |
} | |
$referringRequest = $this->request->getReferringRequest(); | |
if ($referringRequest !== NULL) { | |
$originalRequest = clone $this->request; | |
$this->request->setOriginalRequest($originalRequest); | |
$this->request->setOriginalRequestMappingResults($this->arguments->getValidationResults()); | |
$this->forward($referringRequest->getControllerActionName(), $referringRequest->getControllerName(), $referringRequest->getControllerExtensionName(), $referringRequest->getArguments()); | |
} | |
$message = 'An error occurred while trying to call ' . get_class($this) . '->' . $this->actionMethodName . '().' . PHP_EOL; | |
return $message; | |
} else { | |
// @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1 | |
$this->request->setErrors($this->argumentsMappingResults->getErrors()); | |
$errorFlashMessage = $this->getErrorFlashMessage(); | |
if ($errorFlashMessage !== FALSE) { | |
$errorFlashMessageObject = new \TYPO3\CMS\Core\Messaging\FlashMessage( | |
$errorFlashMessage, | |
'', | |
\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR | |
); | |
$this->controllerContext->getFlashMessageQueue()->enqueue($errorFlashMessageObject); | |
} | |
$referrer = $this->request->getInternalArgument('__referrer'); | |
if ($referrer !== NULL) { | |
$this->forward($referrer['actionName'], $referrer['controllerName'], $referrer['extensionName'], $this->request->getArguments()); | |
} | |
$message = 'An error occurred while trying to call ' . get_class($this) . '->' . $this->actionMethodName . '().' . PHP_EOL; | |
return $message; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment