I'm getting the following error:
Line 269: The number of parameters for form hook_validate and hook_submit have changed (Drupal Docs)
function XXX_admin_overview_submit($form_id, $form_values) {
These are not instances of hook_validate/hook_submit -- those hooks are only used on modules that implement their own node types, and would be named XXX_validate and XXX_submit if they were truly hooks. The functions that it's flagging are custom FAPI validate/submit functions. Furthermore, it's not the *number* of parameters that has changed, but the parameters themselves.
The "Drupal Docs" link is going to the right place, so I think this is just a matter of changing the error message to something like:
The parameters for form validation and submission functions have changed to $form, &$form_state. (Drupal docs)
Comments
Comment #1
stella commentedFixed, will be included in the next release. Thanks for spotting this one.
Cheers,
Stella
Comment #2
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #3
fgmAnother consequence has not been fixed: when implementing
hook_validate()/hook_submit(), you likely have to use$form[<element>][#value], but if the 5.x/6.x conversion check is enabled, coder warns to use $form_state instead, although $form_state does not exist in these hooks, which are not form validation/submit handlers.This probably means that the regexp triggers on
/_[validate|submit]$/without doing an exception for/^<module>_[validate|submit]$/, which is characteristic of ahook_validate()/hook_submit()implementation, as opposed to a form handler.Comment #4
douggreen commentedCan you provide a test case?
Comment #5
klausiCoder 7.x is frozen now and will not receive updates. Coder 8.x-2.x can be used to check code for any Drupal version, Coder 8.x-2.x also supports the phpcbf command to automatically fix conding standard errors. Please check if this issue is still relevant and reopen against that version if necessary.