[FLOW3-general] Validation and flashMessages

Rudy Gnodde rgn at windinternet.nl
Wed Feb 13 16:48:09 CET 2013


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