You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We have a module name containing _deploy and in the .module file we have various Drupal hooks (eg. hook_form_FORM_ID_alter). After upgrading to Drupal 10.3, Drush 12.5.3 is calling these hooks because our module name or hook name. Drush deploy is then failing with this error:
> [notice] Deploy hook started: woot_deploy_form_node_page_edit_form_alter
> [notice] Performed: woot_deploy_form_node_page_edit_form_alter
> [notice] Deploy hook started: woot_deploy_form_node_page_form_alter
> [error] ArgumentCountError: Too few arguments to function woot_deploy_form_node_page_form_alter(), 1 passed in /vendor/drush/drush/src/Commands/core/DeployHookCommands.php on line 187 and exactly 3 expected in woot_deploy_form_node_page_form_alter() (line 79 of /docroot/modules/custom/woot_deploy/woot_deploy.module) #0 /vendor/drush/drush/src/Commands/core/DeployHookCommands.php(187): woot_deploy_form_node_page_form_alter(Array)
To Reproduce
Have a module including _deploy at the end of the name and add any Drupal hook to the .module file. eg:
function woot_deploy_form_node_page_edit_form_alter(&$form, FormStateInterface &$form_state, $form_id) {
Do stuff here;
}
Describe the bug
We have a module name containing
_deploy
and in the .module file we have various Drupal hooks (eg.hook_form_FORM_ID_alter
). After upgrading to Drupal 10.3, Drush 12.5.3 is calling these hooks because our module name or hook name. Drush deploy is then failing with this error:To Reproduce
Have a module including
_deploy
at the end of the name and add any Drupal hook to the.module
file. eg:Expected behavior
Don't run/call non-deploy hooks.
Actual behavior
hook_form_FORM_ID_alter is being run as a deploy hook.
Workaround
If all arguments have default values and we add check code, Drush deploy likely won't fail, but I didn't get that far with it.
Alternatively moving the Drupal hooks to a module with a name that doesn't include
_deploy
works.System Configuration
Additional information
Related to #5216
The text was updated successfully, but these errors were encountered: