[FLOW3-general] Validation and flashMessages
Rens Admiraal
renst3 at rensnel.nl
Thu Feb 14 11:57:26 CET 2013
Hey Rudy,
When the validation on the arguments fails you are actually redirected
to the original action. This is working in Extbase like it is in Flow.
If you want to display the validation results of the form I would
suggest using the validationResults viewhelper for that:
http://docs.typo3.org/flow/TYPO3FlowDocumentation/TheDefinitiveGuide/PartV/FluidViewHelperReference.html#f-form-validationresults
Hope this helps
Greetz,
Rens
Op 2/13/13 4:48 PM, Rudy Gnodde schreef:
> Hello all,
>
> I am trying to create a simple Contact book. Using kickstart I've
> created the Controller, Model, Repository, etc. This worked fine, but
> now I want to add basic validation (NotEmpty) to several fields. When I
> try to create a new Contact and leave those fields empty I get the
> expected "This property is required." messages, but I also get a
> flashMessage "An error occurred while trying to call
> Wind\Petear\Controller\ContactController->createAction()".
>
> After searching the code and online for a while I found this happens
> when you call an action and the given parameters don't validate. The
> only way I've found to give a clean error is to override the default
> getErrorFlashMessage method in my controller, check which action was
> called and return a better error message.
>
> Is this the correct way to do it? Shouldn't the browser be redirected
> back to the newAction like (I think) it is in Extbase?
>
> Thanks,
>
> Rudy Gnodde
More information about the FLOW3-general
mailing list