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

stella’s picture

Status: Active » Fixed

Fixed, will be included in the next release. Thanks for spotting this one.

Cheers,
Stella

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

fgm’s picture

Version: 6.x-1.x-dev » 6.x-2.0-beta1
Status: Closed (fixed) » Active

Another 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 a hook_validate()/hook_submit() implementation, as opposed to a form handler.

douggreen’s picture

Version: 6.x-2.0-beta1 » 7.x-2.x-dev

Can you provide a test case?

klausi’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Coder 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.