New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent drush from crushing, when module's command extends non-existent class #5860
Comments
I think you need to file issue to the module's queue as well to provide some compatibility with migrate commands |
Thanks for information! Yes, I saw this issue, but I'm not sure, that my problem can be fixed from the module's side, because usually we enable modules via hook_update function, but this function is executed using drush mostly. So, we can enable necessary modules prior to deploy or try to run update.php instead of running drush command for hook_update function. But having this error fixed in drush is also a good way, I think, as long as we already fixed similar issue before. |
Two workarounds:
|
Describe the bug
I'm trying to update from D9 to D10 and to Drush 12.4.3. Along with core update I have to update path_redirect_import module from 1 to 2 version. Version 1 of this module has following dependencies and version 2 has couple of new ones. But the problem is that old version has drush command, extending DrushCommands class and new version's command extends MigrateToolsCommand. On D9 version of the site, which I'm trying to update, migrate_tools module is not enabled and thus system is not aware of its drush command representing class.
To Reproduce
Install site on D9 and Drush 10. Install path_redirect_import module 1st version. Update code to D10, Drush 12 and path_redirect_import to 2. Try to execute any drush command.
Expected behavior
Drush skips such cases without crushing.
Actual behavior
Drush fails with following error:
Workaround
Of course, we can enable needed modules before deployment, but I think, it is helpful for automated deployment to have Drush expecting such cases.
System Configuration
Additional information
Found this PR, which adds try/catch, but in my case this check needs to be added in other places, where
new \ReflectionClass($class)
is usedThe text was updated successfully, but these errors were encountered: