Hi,
I'm trying to implement complex form validation for a module admin form. The form validation will require a couple of form fields and then run some queries on the Internet. I'm looking for advice how to best implement this.
I've come across the onContentNormaliseRequestData event, and I think I can make this work more or less, but it doesn't feel optimal.
- onContentNormaliseRequestData is triggered before the server-side field validators are executed. Thus,the order of validations is not optimal.
- I don't know how to pass return information or error messages from the plug-in. It appears that nothings gets done with the error messages, nor with the return status, see libraries/src/MVC/Controller/FormController.php.ModulesControllerModule->save(): lineno 708
- I would have hoped that there is a simpler mechanism, similar to the server-side field validation mechanism, to implement such form validation.
Best regards, Paul