[TYPO3-mvc] 6.2: How to debug recursive validation

Helmut Hummel helmut.hummel at typo3.org
Mon May 19 18:16:03 CEST 2014


Hi Till!

On 17.05.14 15:52, g4-lisz at tonarchiv.ch wrote:

> Is there a way to make the errors a little bit more
> communicative?

The error message you see is compiled in the errorAction in the 
ActionController class in Extbase.

You can override this method in your controller (be careful to copy and 
paste everything necessary for the rewritten property mapper you see in 
this method).

In this method you have access to the error messages from validation:

By calling $this->arguments->getValidationResults()

You could e.g. iterate over the flattened errors and add them to the 
message, but be careful and only do this during debugging, as we removed 
verbosity there because of a security issue[1]


foreach ($this->arguments->getValidationResults()->getFlattenedErrors() 
as $propertyPath => $errors) {
	foreach ($errors as $error) {
		$message .= 'Error for ' . $propertyPath . ':  ' . $error->render() . 
PHP_EOL;
	}
}


I would be interested in your findings.


Kind regards,
Helmut

[1]https://review.typo3.org/26217

-- 
Helmut Hummel
Release Manager TYPO3 6.0
TYPO3 Core Developer, TYPO3 Security Team Member

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the TYPO3-project-typo3v4mvc mailing list