I am writing a module that adds fields to Simplenews forms, including a custom submit handler. This is working fine on my test site, but when i migrate to my production site, I get the following error:
Recoverable fatal error: Argument 2 passed to simple_conreg_simplenews_form_submit() must be an instance of FormStateInterface, instance of Drupal\\Core\\Form\\FormState given in /var/www/drupal/sites8/all/modules/simple_conreg/simple_conreg.module on line 193
My handler is defined as:
function simple_conreg_simplenews_form_submit ($form, FormStateInterface $form_state)
I can get it to work on my production site by changing to:
function simple_conreg_simplenews_form_submit ($form, $form_state)
However, it would be nice to have type checking enforced.
Any idea why this is happening when the same definition works on the test site?