Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Implementing hook_msfn_info_steps_alter with $form_state throws the following error:
Warning: Missing argument 5 for mymodule_msnf_info_steps_alter(), called in docroot/includes/module.inc on line 1101 and defined in mymodule_msnf_info_steps_alter() (line 845 of docroot/sites/all/modules/custom/mymodule/mymodule.module).
It seems that $form_state is not passed to this function. This seems similar to this issue. I suspect this could use a patch or the documentation should be modified to better describe how to use the api.
Comments
Comment #1
daggerhart CreditAttribution: daggerhart commentedIt took me a few issues to find a fix for this.
Patch here: https://drupal.org/node/1967284
And use of api hook here: https://drupal.org/node/1461948#comment-6897834
Resulting in an example that looks more like this:
Additionally, there is a mistake in the function msnf_attach_steps().
Find:
$steps = msnf_info_steps($entity_type, $bundle, $element, $form_state);
Replace with:
$steps = msnf_info_steps($entity_type, $bundle, FALSE, $element, $form_state);
Not sure if this is the accepted fix/implementation, but it works for me. Hope this helps.
Comment #2
rooby CreditAttribution: rooby commentedThis is a duplicate of #1967284: Calling drupal_alter() with too many parameters, which has a patch to fix this.