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
This was originally reported in #5112 by @idiazroncero.
I noticed a rather specific error when the module's name contains the substring _deploy on its name.
Take mymodule_deploy as an example, with a mymodule_deploy_deploy_myfunction deploy hook and a mymodule_deploy.deploy.php file.
Running drush deploy:hook will fail with the following error:
[warning] Deploy hook function mymodule_deploy_deploy_myfunction not found in file mymodule.deploy.php
This is because list($module, $name) = explode('_deploy_', $function, 2); will set $module to just mymodule and not mymodule_deploy and, thus, the $filename will be wrong.
This is an uncommon but not rare scenario. In fact, it happened to me because I had a separate custom module dedicated to deploy hooks that had the deploy substring on the name.
To Reproduce
Create a module named myproject_deploy.
Create a myproject_deploy.deploy.php file which has a deploy function named myproject_deploy_deploy_my_update().
Run drush deploy
Expected behavior
Deploy hook is executed normally.
Actual behavior
[warning] Deploy hook function myproject_deploy_deploy_my_update not found in file myproject.deploy.php
[error] Deploy hook failed: myproject_deploy_deploy_my_update
[error] Update aborted by: myproject_deploy_deploy_my_update
The text was updated successfully, but these errors were encountered:
…e. (#5217)
* Test execution of deploy hooks inside a module with _deploy in the name.
Test for #5216
* Support deploy hooks in modules with _deploy in the name.
Describe the bug
This was originally reported in #5112 by @idiazroncero.
To Reproduce
myproject_deploy
.myproject_deploy.deploy.php
file which has a deploy function namedmyproject_deploy_deploy_my_update()
.drush deploy
Expected behavior
Deploy hook is executed normally.
Actual behavior
The text was updated successfully, but these errors were encountered: