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

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Mon May 19 20:08:16 CEST 2014


Hi Helmut,

thank you so much!

That was the hint I was looking for.

Now I get a message which really tells me what is going wrong - with
this information I should be able to fix it.

The message says: Error for klinik.apparativausstattung: The given
subject was not a collection.

Best regards,
Till

On 05/19/2014 06:16 PM, Helmut Hummel wrote:
> 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
>



More information about the TYPO3-project-typo3v4mvc mailing list