- Issue created by @paulbeaney
- πΊπΈUnited States nicxvan
Quick disclaimer, I'm not the original author so any other advice would be greatly appreciated. I think this is generally a side effect of drush updates.
We want to keep that alter check cause I think that keeps recursion from happening.
So the hook implements alter alters how the implementations are called.
Drush is supposed to boot the migrate boost.I tried to make it more backwards compatible with this, but something is missing.
public static function bootDrush($command) { // Check if $command is an instance of ArgvInput. if ($command instanceof ArgvInput) { $command_name = $command->getFirstArgument(); } else { // Assuming it's an array for backward compatibility. $command_name = $command['command']; } if (in_array($command_name, static::getConfig('commands'))) { static::enable(); } else { static::disable(); } }
So for some reason the enable command is not being called which means either the command name is not picked up or the commands config is failing.
Can you share your Drush version?
- π«π·France paulbeaney
Thanks for getting back to me and sorry for omitting that rather important bit of info! I am using drush 12.5.3.0.
I'm not familiar with the inner workings of drush so I haven't been able to dig too deep yet, but initial debugging seems to indicate that functions such as initCommand(), boosterEnable() and bootDrush() only get called when running either of the Migrate Boost module's own commands (i.e. enable or reset). The rest of the time, the first thing that gets called seems to be MigrateBoost::alter().
I'll keep digging and feedback anything I find and if you have any ideas of where to look, I am all ears!
- π«π·France paulbeaney
I have made what I think is some good progress on this - at least, it works, and it doesn't seem to interfere with drush commands other than the two this module is targetting. I have implemented 2 annotated hooks in MigrateBoostCommands which run before migrate:import and migrate:rollback (one callback to target each command) and simply call MigrateBoost::enable().
I have created a fork and updated the file on GitHub, but this is my first foray into non-patch contribution, so if I need to do anything else to make it visible or otherwise complete the process, please let me know!
- πΊπΈUnited States nicxvan
Oh that looks good, I'll try to test it in a bit!
- Status changed to Fixed
24 days ago 2:32am 25 November 2024 - πΊπΈUnited States nicxvan
I've merged this in, I left it in .dev so it can be tested a bit.
Automatically closed - issue fixed for 2 weeks with no activity.