Right know plugins' configFormValidate() and configFormSubmit() methods only get a &values array as a parameter however $form_state would be also useful many times. For example if someone would like to redirect the user after a form submission he would be able to use $form_state['redirect'] instead of drupal_goto(). But this is just an example.

Comments

whitelikeman created an issue.

MegaChriz’s picture

This is an interesting thought. The problem is though that configFormValidate() and configFormSubmit() are not always called from the same form. It can be a form on the importer settings page, the standalone import form or a node form. As such, it becomes very unpredictable what is exactly in $form_state. Because of that, I think we shouldn't pass $form_state to these methods.

As an alternative, you can use a form alter hook to perform the needed extra logic, such as a redirect.

Do you agree with me?